Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Checkboxes AND logic › Reply To: Checkboxes AND logic
January 4, 2019 at 11:24 am
#20640
Keymaster
Hi!
Well, there is no option there to change the logic, but with a custom code it might be possible. I will make sure to add a logic option for multi-select cases, it makes sense.
So, to resolve this, let’s try a custom code. Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter( 'asp_query_args', 'asp_and_logic_on_multiselect_cf', 10, 1 );
function asp_and_logic_on_multiselect_cf($args) {
foreach ( $args['post_meta_filter'] as &$filter ) {
if ( is_array($filter['value']) ) {
$filter['logic'] = 'AND';
}
}
return $args;
}