Date format issue
-
Hi there, according to the latest changes to the core, how should I transform the dates below?
function et_last_modified_date_blog( $the_date ) { if ( 'post' === get_post_type() ) { $the_time = get_post_time( 'His' ); $the_modified = get_post_modified_time( 'His' ); $last_modified = sprintf( __( 'Last updated %s', 'Divi' ), esc_html( get_post_modified_time( 'd m Y \a\l\l\e g:iA' ) ) ); $published = sprintf( __( 'Del %s', 'Divi' ), esc_html( get_post_time( 'd m Y' ) ) ); $date = $the_modified !== $the_time ? $last_modified . ' | ' . $published : $published; return $date; } } add_action( 'get_the_date', 'et_last_modified_date_blog' ); add_action( 'get_the_time', 'et_last_modified_date_blog' );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Date format issue’ is closed to new replies.