Forums › Forums › Search & Filter Pro › Filter Dropdown options
- This topic has 6 replies, 2 voices, and was last updated 9 years, 9 months ago by
Ross.
Viewing 6 posts - 1 through 6 (of 6 total)
-
Ross Moderator(Private) January 15, 2016 at 2:30 pm #34366
Hi Jacob sorry for the delay.
You’re almost there.
First, you have only 1
=in the firstifstatement.So it does the code for every single field – this needs to be changed to a double
==Second, I think likely you got the fieldname wrong – see here on how to get the correct fieldname:
Here is your code updated (and I’m guessing the field name is from meta data, otherwise you need to find the name as link just above:
<?php function filter_input_object($input_object, $sfid) { if(($input_object['name'] == '_sfm_workshop_location')) { foreach($input_object['options'] as $option) { $option->label = get_the_title($option->value); } return $input_object; } else { return $input_object; } } add_filter('sf_input_object_pre', 'filter_input_object', 10, 2); ?>Thanks
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)