Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Search & Filter Pro - Filter - sf_edit_query_args
Takes 2 paramaters -
$query_args - an array of query arguments - this is the same as teh `$args` variable that gets passed to to `WP_Query`-
$sfid - this is the numeric ID of the Search Form
Make sure to return $query_args after you have modified it as with all WP filters
function sf_filter_query_args( $query_args, $sfid ) {
//if search form ID = 225, the do something with this query
//modify $query_args here before returning it
return $query_args;
add_filter( 'sf_edit_query_args', 'sf_filter_query_args', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.