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

Reply To: Using date_format on custom date field returns “now”

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”

#52161
YansYans
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!