Posts, Post Types: Introduce `post_date_column_status` filter for post status text in list tables' Date column.
Props pbearne. Fixes #39545. Built from https://develop.svn.wordpress.org/trunk@40361 git-svn-id: http://core.svn.wordpress.org/trunk@40268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2b48ca580e
commit
f884d7973b
|
@ -993,17 +993,33 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 'publish' === $post->post_status ) {
|
if ( 'publish' === $post->post_status ) {
|
||||||
_e( 'Published' );
|
$status = __( 'Published' );
|
||||||
} elseif ( 'future' === $post->post_status ) {
|
} elseif ( 'future' === $post->post_status ) {
|
||||||
if ( $time_diff > 0 ) {
|
if ( $time_diff > 0 ) {
|
||||||
echo '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
|
$status = '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
|
||||||
} else {
|
} else {
|
||||||
_e( 'Scheduled' );
|
$status = __( 'Scheduled' );
|
||||||
}
|
}
|
||||||
} else {
|
} 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 ) {
|
if ( 'excerpt' === $mode ) {
|
||||||
/**
|
/**
|
||||||
* Filters the published time of the post.
|
* Filters the published time of the post.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.8-alpha-40360';
|
$wp_version = '4.8-alpha-40361';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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