diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index cac03b1fe3630..6cb0c881f9c94 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -1014,16 +1014,19 @@ function wp_dashboard_recent_posts( $args ) { $time = get_the_time( 'U' ); - if ( gmdate( 'Y-m-d', $time ) === $today ) { - $relative = __( 'Today' ); + if ( ! is_int( $time ) ) { + /* translators: Date and time format for recent posts on the dashboard, from a different calendar year, see https://www.php.net/manual/datetime.format.php */ + $date = get_the_date( __( 'M jS Y' ) ); + } elseif ( gmdate( 'Y-m-d', $time ) === $today ) { + $date = __( 'Today' ); } elseif ( gmdate( 'Y-m-d', $time ) === $tomorrow ) { - $relative = __( 'Tomorrow' ); + $date = __( 'Tomorrow' ); } elseif ( gmdate( 'Y', $time ) !== $year ) { /* translators: Date and time format for recent posts on the dashboard, from a different calendar year, see https://www.php.net/manual/datetime.format.php */ - $relative = date_i18n( __( 'M jS Y' ), $time ); + $date = date_i18n( __( 'M jS Y' ), $time ); } else { /* translators: Date and time format for recent posts on the dashboard, see https://www.php.net/manual/datetime.format.php */ - $relative = date_i18n( __( 'M jS' ), $time ); + $date = date_i18n( __( 'M jS' ), $time ); } // Use the post edit link for those who can edit, the permalink otherwise. @@ -1033,7 +1036,7 @@ function wp_dashboard_recent_posts( $args ) { printf( '