[ad_1]
Also is there a way to make it work with multiple different pods, not just ‘rebate_applications’?
Thanks!
I’m going to sleep at the moment so sorry if this is too short, but the date time string can be parsed to a date integer with https://www.php.net/manual/en/function.strtotime.php then parsed back to a string with https://www.php.net/manual/en/function.date.php
You can get the post type from the post ID with
@reedus33
<?php
add_shortcode(
'date_only',
function( $atts, $content, $shortcode_tag ) {
return return_date_only( get_the_ID() );
}
);
function return_date_only( $id ) {
$date_time = get_post_meta( $id, 'application_date', true );
return date(
'M j, Y',
strtotime( $date_time )
);
}
