Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › limit search › Reply To: limit search
October 6, 2022 at 3:49 pm
#39544
Participant
Hello Ernest,
but in your code here
add_filter( 'asp_query_args', 'asp_include_only_parent_ids', 10, 2 );
function asp_include_only_parent_ids( $args, $id ) {
if ( $id == 3 ) {
$args['post_parent'] = array(11748);
} else if ( $id == 12 ) {
$args['post_parent'] = array(3239);
}
$args['post_meta_filter'][] = array(
'key' => 'customfield', // meta key
'value' => 'abc'
'operator' => 'LIKE', // You can also try ELIKE here for more strict match
'allow_missing' => false // allow match if this custom field is unset
);
return $args;
}
there is not this logic integrated:
If widget ID 3 –> post_parent = 11748 OR customfield = abc;
If widget ID 12 –> post_parent = 5000 OR customfield = xyz;
There is a chance to archive this?