Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › terms filter on custom page › Reply To: terms filter on custom page
January 23, 2025 at 8:39 am
#52596
Keymaster
Sure! You can try this:
add_filter('asp_query_args', function ( $args, $search_id, $options ) {
$args['post_meta_filter'][] = array(
'key' => 'expiration_date',
'value' => time(),
'operator' => '>',
'allow_missing' => true,
);
return $args;
}, 10, 3);
You can set the ‘allow_missing’ to false if you want to exclude items where the expiration_date field does not exist 🙂