Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › AND logic between post tag multiselect › Reply To: AND logic between post tag multiselect
April 28, 2021 at 10:06 am
#32963
Keymaster
Hi,
There is no option for that unfortunately, the logic automatically falls back to “OR” when using the multiselect. There still might be a way to force it programmatically.
Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
add_filter("asp_query_args", "asp_query_args_change1", 10, 2);
function asp_query_args_change1($args, $search_id) {
foreach ($args['post_tax_filter'] as $k => &$item) {
if ( $item['taxonomy'] == 'post_tag' ) {
$item['logic'] = 'andex';
}
}
return $args;
}