Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Using date_format on custom date field returns “now” › Reply To: Using date_format on custom date field returns “now”
December 5, 2024 at 2:57 pm
#52161
Participant
Another question.
I am trying to limit the search results to upcoming events by adding a filter to limit results with evcal_srow greater or equal to now.
I adapted the code in the documentation:
add_filter('asp_query_args', 'asp_upcoming_events_filter', 10, 1);
function asp_upcoming_events_filter( $args ) {
$args['post_meta_filter'][] = array(
'key' => 'evcal_srow',
'value' => time(),
'operator' => '>=',
'allow_missing' => false
);
return $args;
}
But it doesn’t have any effect.
How can I make sure the filter targets the specific search ID?
Thanks!