Posts, Post Types: Introduce `post_date_column_status` filter for post status text in list tables' Date column.

Props pbearne.
Fixes #39545.

git-svn-id: https://develop.svn.wordpress.org/trunk@40361 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-04-01 14:07:01 +00:00
parent 7fcef3062b
commit d766856878
1 changed files with 21 additions and 5 deletions

View File

@ -993,17 +993,33 @@ class WP_Posts_List_Table extends WP_List_Table {
}
if ( 'publish' === $post->post_status ) {
_e( 'Published' );
$status = __( 'Published' );
} elseif ( 'future' === $post->post_status ) {
if ( $time_diff > 0 ) {
echo '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
$status = '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
} else {
_e( 'Scheduled' );
$status = __( 'Scheduled' );
}
} else {
_e( 'Last Modified' );
$status = __( 'Last Modified' );
}
echo '<br />';
/**
* Filters the status text of the post.
*
* @since 4.8.0
*
* @param string $status The status text.
* @param WP_Post $post Post object.
* @param string $column_name The column name.
* @param string $mode The list display mode ('excerpt' or 'list').
*/
$status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode );
if ( $status ) {
echo $status . '<br />';
}
if ( 'excerpt' === $mode ) {
/**
* Filters the published time of the post.