Forums › Forums › Search & Filter Pro › Customize Value Postfix
- This topic has 23 replies, 3 voices, and was last updated 5 years, 5 months ago by Anonymous.
-
Trevor(Private) June 25, 2019 at 6:36 pm #214927
It shouldn’t have the dollar symbol, no.
I can see an error also, so try this:
function add_miles_to_filter_labels($input_object, 2116) { if(($input_object['name']!='_sfm_distance[]') { return $input_object; } foreach($input_object['options'] as $option) { $option->label .= " miles"; } return $input_object; } add_filter('sf_input_object_pre', 'add_miles_to_filter_labels', 10, 2);
Trevor(Private) June 25, 2019 at 7:00 pm #214935Spotted another errod, sorry.
function add_miles_to_filter_labels($input_object, 2116) { if($input_object['name']!='_sfm_distance[]') { return $input_object; } foreach($input_object['options'] as $option) { $option->label .= " miles"; } return $input_object; } add_filter('sf_input_object_pre', 'add_miles_to_filter_labels', 10, 2);
Trevor(Private) June 27, 2019 at 4:32 pm #215141I had a thought. Try this:
function add_miles_to_filter_labels($input_object, $sfid) { if(($input_object['name']!='_sfm_distance[]'||($sfid != 2216)) { return $input_object; } foreach($input_object['options'] as $option) { $option->label .= " miles"; } return $input_object; } add_filter('sf_input_object_pre', 'add_miles_to_filter_labels', 10, 2);
-
AuthorPosts