Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Using the asp_query_args filter to always include products with a specific term › Reply To: Using the asp_query_args filter to always include products with a specific term
February 12, 2020 at 12:52 pm
#25787
Keymaster
Hi Paul,
Well, you can try a custom function, that lets you inject SQL queries within the main search query:
add_filter( 'asp_query_args', 'asp_custom_query_args', 10, 2 );
function asp_custom_query_args($args, $search_id) {
$args['cpt_query'] = array(
'fields' => '',
'join' => '',
'where' => '',
'orderby' => ''
);
return $args;
}
These are replaced in wp-content/plugins/ajax-search-pro/includes/classes/search/class-asp-search-cpt.php file, namely the {args_fields}, {args_join} etc.. pseudo variables.
You might have to directly modify the query within the same file.