Administration: Unify the date structure in list view and excerpt view.

Both views now show a full date string. Something like `Published 2020/05/27 at 10:25 pm`.

Fixes: #35391.
Props: afercia, ocean90, TimothyBlynJacobs, audrasjb, SergeyBiryukov, joedolson.


Built from https://develop.svn.wordpress.org/trunk@47879


git-svn-id: http://core.svn.wordpress.org/trunk@47653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake 2020-06-01 19:15:08 +00:00
parent f201c1b217
commit 69a866a1a9
6 changed files with 34 additions and 51 deletions

View File

@ -296,7 +296,6 @@ table.fixed {
}
.fixed .column-posts,
.fixed .column-date,
.fixed .column-parent,
.fixed .column-links,
.fixed .column-author,
@ -304,6 +303,10 @@ table.fixed {
width: 10%;
}
.fixed .column-date {
width: 14%;
}
.column-date span[title] {
-webkit-text-decoration: dotted underline;
text-decoration: dotted underline;
@ -391,10 +394,6 @@ table.media .column-title .filename {
width: 20%;
}
#comments-form .fixed .column-date {
width: 14%;
}
#commentsdiv.postbox .inside {
margin: 0;
padding: 0;
@ -1635,10 +1634,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) {

File diff suppressed because one or more lines are too long

View File

@ -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) {

File diff suppressed because one or more lines are too long

View File

@ -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 . '<br />';
}
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 '<span title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, 'date', $mode ) . '</span>';
}
/**
* 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 );
}
/**

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-47878';
$wp_version = '5.5-alpha-47879';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.