Forums › Forums › Search & Filter Pro › Wrap filter items in a div
- This topic has 4 replies, 2 voices, and was last updated 5 years, 9 months ago by Trevor.
Viewing 5 posts - 1 through 5 (of 5 total)
-
Anonymous(Private) February 16, 2018 at 12:33 pm #160225
Hi, I’m trying to wrap
<li>
items in the filter in a div so I can easily apply an accordion to them. I’ve been using sf_input_object_pre to modify the prefix and postfix but they don’t seem to insert anything into the HTML – can someone confirm what these attributes do? And if they don’t insert any prefix or postfix, is there a way I can add HTML to the filter list?
Thanks.function filter_function_name($input_object, $sfid) { if($input_object['type']!='checkbox') { return $input_object; } foreach($input_object['options'] as $key => $option) { if ($option->attributes['class']="sf-level-0") { $input_object['options'][$key]->prefix = '<div>'; $input_object['options'][$key]->postfix= '</div>'; } } return $input_object; } add_filter('sf_input_object_pre', 'filter_function_name', 10, 2);
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)