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 3:34 pm
#52162
Keymaster
Hi,
What happens if you try it without the date format:
{evcal_srow}
I’m asking because there might be a hook somewhere attached to the get_field function I suspect. If you get the same values, then it’s okay, if the timestamps change for each search, then that may indicate an issue somewhere.
Is is also strange that your custom code for filtering events does not work – that should definitely do something, it looks correct to me.
You can limit it to specific search IDs as well, with an additional argument:
add_filter('asp_query_args', 'asp_upcoming_events_filter', 10, 2);
function asp_upcoming_events_filter( $args, $search_id ) {
// Do it only for search ID=1
if ( $search_id == 1 ) {
$args['post_meta_filter'][] = array(
'key' => 'evcal_srow',
'value' => time(),
'operator' => '>=',
'allow_missing' => false
);
}
return $args;
}