Post_Meta Date Conversion
-
I’d like to convert the date post_meta field events from 2018-08-07 to August 7th. From looking at other support questions I could use the date function. I also saw how I could pull a new field for the post_meta. I’m trying to do this because I’m using a plugin that can display post meta data but is unable to use the date function to convert the appearance.
What I thought might work:
function ccb_core_customize_calendar_fields( $post_type_maps ) { if ( ! empty( $post_type_maps['ccb_core_calendar']['fields'] ) ) { date( 'F js', strtotime($post_type_maps['ccb_core_calendar']['fields']['date')])) = 'post_meta'; } return $post_type_maps; } add_filter( 'ccb_core_synchronizer_post_api_map', 'ccb_core_customize_calendar_fields', 20, 1 );What is a better way to go about this?
The topic ‘Post_Meta Date Conversion’ is closed to new replies.