This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: terms filter on custom page

#52596
Ernest MarcinkoErnest Marcinko
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 🙂