- This topic has 2 replies, 2 voices, and was last updated 8 years, 7 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Filter default values
Tagged: filter default values, sf_input_object_pre
Hi,
I have 3 filter dropdowns (categories, tags and a custom taxonomy).
It’s working fine, but I wonder if it’s possible to select values of those three dropdowns based on a session I made?
Each user has it’s own preferences in it’s profile, based on that, they should have the search result filtered when they visit the page. However, they should be able to change the filters afterwards.
Anyone has a clue how to do it?
Thanks!
You might be able to do it with custom coding using our Edit Query Arguments filter. But I would not know how. There are examples users have posted in this forum that they have written.
Thanks for the link.
I fixed it the following way:
function filter_function_name($input_object, $sfid) {
if($input_object['name']=='xxx') {
$input_object['defaults'] = array("yyy");
}
return $input_object;
}
add_filter('sf_input_object_pre', 'filter_function_name', 10, 2);