Can this line:
$message = str_replace( '[post_date]', $post->post_date, $message );
be modified so the date displayed for the [post_date] shortcode is formatted as Saturday, 12/03/16, 08:43 ?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
Instead of using
get_the_time( $format, $post ).
The correct PHP date format string for your question is
... Assuming you want a two digit minute (even when less that 10 minutes). Also, I may have the month and day the wrong way around for you.
The format argument in
get_the_time() is PHP's native date format - http://php.net/manual/en/function.date.php
Then, change your line of code to:
$message = str_replace( '[post_date]', get_the_time( 'd/m/y H:i', $post ), $message );
Though, I think it'll be easier and neater to just add the
get_the_time( 'd/m/y H:i', $post ) to your template, rather than having to put a shortcode into each post.