diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css index 9aaaefebe0..277bef152e 100644 --- a/src/wp-admin/css/list-tables.css +++ b/src/wp-admin/css/list-tables.css @@ -295,7 +295,6 @@ table.fixed { } .fixed .column-posts, -.fixed .column-date, .fixed .column-parent, .fixed .column-links, .fixed .column-author, @@ -303,6 +302,10 @@ table.fixed { width: 10%; } +.fixed .column-date { + width: 14%; +} + .column-date span[title] { -webkit-text-decoration: dotted underline; text-decoration: dotted underline; @@ -390,10 +393,6 @@ table.media .column-title .filename { width: 20%; } -#comments-form .fixed .column-date { - width: 14%; -} - #commentsdiv.postbox .inside { margin: 0; padding: 0; @@ -1634,10 +1633,6 @@ div.action-links, .plugin-card .desc p:first-of-type { margin-top: 0; } - - .fixed .column-date { - width: 14%; - } } @media screen and (max-width: 782px) { diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 3b29dce7d2..69493c3200 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -1065,19 +1065,19 @@ class WP_Posts_List_Table extends WP_List_Table { if ( '0000-00-00 00:00:00' === $post->post_date ) { $t_time = __( 'Unpublished' ); - $h_time = $t_time; $time_diff = 0; } else { - $t_time = get_the_time( __( 'Y/m/d g:i:s a' ), $post ); + $t_time = sprintf( + /* translators: 1: Post date, 2: Post time. */ + __( '%1$s at %2$s' ), + /* translators: Post date format. See https://www.php.net/date */ + get_the_time( __( 'Y/m/d' ), $post ), + /* translators: Post time format. See https://www.php.net/date */ + get_the_time( __( 'g:i a' ), $post ) + ); + $time = get_post_timestamp( $post ); $time_diff = time() - $time; - - if ( $time && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) { - /* translators: %s: Human-readable time difference. */ - $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) ); - } else { - $h_time = get_the_time( __( 'Y/m/d' ), $post ); - } } if ( 'publish' === $post->post_status ) { @@ -1108,27 +1108,20 @@ class WP_Posts_List_Table extends WP_List_Table { echo $status . '
'; } - if ( 'excerpt' === $mode ) { - /** - * Filters the published time of the post. - * - * If `$mode` equals 'excerpt', the published time and date are both displayed. - * If `$mode` equals 'list' (default), the publish date is displayed, with the - * time and date together available as an abbreviation definition. - * - * @since 2.5.1 - * - * @param string $t_time The published time. - * @param WP_Post $post Post object. - * @param string $column_name The column name. - * @param string $mode The list display mode ('excerpt' or 'list'). - */ - echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode ); - } else { - - /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ - echo '' . apply_filters( 'post_date_column_time', $h_time, $post, 'date', $mode ) . ''; - } + /** + * Filters the published time of the post. + * + * @since 2.5.1 + * @since 5.5.0 Removed the difference between 'excerpt' and 'list' modes. + * The published time and date are both displayed now, + * which is equivalent to the previous 'excerpt' mode. + * + * @param string $t_time The published time. + * @param WP_Post $post Post object. + * @param string $column_name The column name. + * @param string $mode The list display mode ('excerpt' or 'list'). + */ + echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode ); } /**