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”

#52181
Ernest MarcinkoErnest Marcinko
Keymaster

All right, no problem. In that case let’s solve this via a custom code snippet.

First, make sure to use the field like this (without the date format, so it’s not processed):

{evcal_srow}

Then use this custom code snippet:

add_filter('asp_cpt_advanced_field_value', function($value, $field_name){
	if ( $field_name != 'evcal_srow' ) {
		return $value;
	}
	return date_i18n( "F j, Y", $value);
}, 10,2);

This will process the field afterwards, and hopefully should do the trick.