Make WordPress Core

Changeset 40361


Ignore:
Timestamp:
04/01/2017 02:07:01 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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

Props pbearne.
Fixes #39545.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r40309 r40361  
    994994
    995995        if ( 'publish' === $post->post_status ) {
    996             _e( 'Published' );
     996            $status = __( 'Published' );
    997997        } elseif ( 'future' === $post->post_status ) {
    998998            if ( $time_diff > 0 ) {
    999                 echo '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
     999                $status = '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
    10001000            } else {
    1001                 _e( 'Scheduled' );
     1001                $status = __( 'Scheduled' );
    10021002            }
    10031003        } else {
    1004             _e( 'Last Modified' );
    1005         }
    1006         echo '<br />';
     1004            $status = __( 'Last Modified' );
     1005        }
     1006
     1007        /**
     1008         * Filters the status text of the post.
     1009         *
     1010         * @since 4.8.0
     1011         *
     1012         * @param string  $status      The status text.
     1013         * @param WP_Post $post        Post object.
     1014         * @param string  $column_name The column name.
     1015         * @param string  $mode        The list display mode ('excerpt' or 'list').
     1016         */
     1017        $status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode );
     1018
     1019        if ( $status ) {
     1020            echo $status . '<br />';
     1021        }
     1022
    10071023        if ( 'excerpt' === $mode ) {
    10081024            /**
Note: See TracChangeset for help on using the changeset viewer.