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:
parent
f201c1b217
commit
69a866a1a9
|
@ -296,7 +296,6 @@ table.fixed {
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed .column-posts,
|
.fixed .column-posts,
|
||||||
.fixed .column-date,
|
|
||||||
.fixed .column-parent,
|
.fixed .column-parent,
|
||||||
.fixed .column-links,
|
.fixed .column-links,
|
||||||
.fixed .column-author,
|
.fixed .column-author,
|
||||||
|
@ -304,6 +303,10 @@ table.fixed {
|
||||||
width: 10%;
|
width: 10%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixed .column-date {
|
||||||
|
width: 14%;
|
||||||
|
}
|
||||||
|
|
||||||
.column-date span[title] {
|
.column-date span[title] {
|
||||||
-webkit-text-decoration: dotted underline;
|
-webkit-text-decoration: dotted underline;
|
||||||
text-decoration: dotted underline;
|
text-decoration: dotted underline;
|
||||||
|
@ -391,10 +394,6 @@ table.media .column-title .filename {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#comments-form .fixed .column-date {
|
|
||||||
width: 14%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#commentsdiv.postbox .inside {
|
#commentsdiv.postbox .inside {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -1635,10 +1634,6 @@ div.action-links,
|
||||||
.plugin-card .desc p:first-of-type {
|
.plugin-card .desc p:first-of-type {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed .column-date {
|
|
||||||
width: 14%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 782px) {
|
@media screen and (max-width: 782px) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -295,7 +295,6 @@ table.fixed {
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed .column-posts,
|
.fixed .column-posts,
|
||||||
.fixed .column-date,
|
|
||||||
.fixed .column-parent,
|
.fixed .column-parent,
|
||||||
.fixed .column-links,
|
.fixed .column-links,
|
||||||
.fixed .column-author,
|
.fixed .column-author,
|
||||||
|
@ -303,6 +302,10 @@ table.fixed {
|
||||||
width: 10%;
|
width: 10%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixed .column-date {
|
||||||
|
width: 14%;
|
||||||
|
}
|
||||||
|
|
||||||
.column-date span[title] {
|
.column-date span[title] {
|
||||||
-webkit-text-decoration: dotted underline;
|
-webkit-text-decoration: dotted underline;
|
||||||
text-decoration: dotted underline;
|
text-decoration: dotted underline;
|
||||||
|
@ -390,10 +393,6 @@ table.media .column-title .filename {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#comments-form .fixed .column-date {
|
|
||||||
width: 14%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#commentsdiv.postbox .inside {
|
#commentsdiv.postbox .inside {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -1634,10 +1633,6 @@ div.action-links,
|
||||||
.plugin-card .desc p:first-of-type {
|
.plugin-card .desc p:first-of-type {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed .column-date {
|
|
||||||
width: 14%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 782px) {
|
@media screen and (max-width: 782px) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1065,19 +1065,19 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||||
|
|
||||||
if ( '0000-00-00 00:00:00' === $post->post_date ) {
|
if ( '0000-00-00 00:00:00' === $post->post_date ) {
|
||||||
$t_time = __( 'Unpublished' );
|
$t_time = __( 'Unpublished' );
|
||||||
$h_time = $t_time;
|
|
||||||
$time_diff = 0;
|
$time_diff = 0;
|
||||||
} else {
|
} 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 = get_post_timestamp( $post );
|
||||||
$time_diff = time() - $time;
|
$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 ) {
|
if ( 'publish' === $post->post_status ) {
|
||||||
|
@ -1108,27 +1108,20 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||||
echo $status . '<br />';
|
echo $status . '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 'excerpt' === $mode ) {
|
/**
|
||||||
/**
|
* Filters the published time of the post.
|
||||||
* Filters the published time of the post.
|
*
|
||||||
*
|
* @since 2.5.1
|
||||||
* If `$mode` equals 'excerpt', the published time and date are both displayed.
|
* @since 5.5.0 Removed the difference between 'excerpt' and 'list' modes.
|
||||||
* If `$mode` equals 'list' (default), the publish date is displayed, with the
|
* The published time and date are both displayed now,
|
||||||
* time and date together available as an abbreviation definition.
|
* which is equivalent to the previous 'excerpt' mode.
|
||||||
*
|
*
|
||||||
* @since 2.5.1
|
* @param string $t_time The published time.
|
||||||
*
|
* @param WP_Post $post Post object.
|
||||||
* @param string $t_time The published time.
|
* @param string $column_name The column name.
|
||||||
* @param WP_Post $post Post object.
|
* @param string $mode The list display mode ('excerpt' or 'list').
|
||||||
* @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 );
|
||||||
*/
|
|
||||||
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>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue