Forums › Forums › Search & Filter Pro › Filter input arguments before they get to S&F
Tagged: filter input values
- This topic has 4 replies, 2 voices, and was last updated 8 years ago by Anonymous.
-
Anonymous(Private) November 7, 2016 at 8:54 am #68948
Hello!
I’d like to filter one or all input components of a search form and change what the user put into them, before sending them to S&F.Something like
function filter_input_values($inputs, $sfid){ if($sfid==365){ if($inputs['_sf_s']['value']) $input['_sf_s']['value'] = NULL; } return $inputs; } add_filter('sf_filter_input_values','filter_input_values', 10, 2);
Any way of acting upon input values like this?
My reason for doing this is for using a field of the search to transfer some data to my backend login, but without changing/impacting the search itself. Or in some cases just correct address data that a user didn’t enter properly.Anonymous(Private) November 7, 2016 at 12:21 pm #68984Thank you Trevor! The issue I was having with
sf_edit_query_args
is that $query_args was empty. I read around in the forum and it turns out I had to use a different priority than the one specified in the docs (like 100) to get results in $query_args using this filter. -
AuthorPosts