Forums › Forums › Search & Filter Pro › Pods Relationship Fields
Tagged: custom fields, pods, post meta
- This topic has 5 replies, 5 voices, and was last updated 5 years ago by
Anonymous.
Viewing 5 posts - 1 through 5 (of 5 total)
-
Ross Moderator(Private) May 13, 2020 at 9:24 am #243695
Hi Jo
This is actually possible using one of our filters – are you comfortable tweaking a little PHP to put in your themes
functions.phpfile?Thanks
Ross Moderator(Private) September 25, 2020 at 10:57 am #260793Hi Sunny
You can replace the ID’s, by post title, by adding this to
functions.php:function filter_input_object($input_object, $sfid) { if(($input_object['name'] == '_sfm_podsrelationship')) { 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);Make sure to change the name of the field to match yours:
_sfm_podsrelationshipTo find your field name, just check the URL when you do a search:
https://searchandfilter.com/documentation/accessing-search-data/?sfref=dc#how-to-get-the-field-nameLet me know how you get on.
Thanks
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)