Make WordPress Core

Ticket #44599: context.patch

File context.patch, 2.3 KB (added by cc0a, 7 years ago)

Patch to add $context variable to post states function.

  • .php

    old new (this hunk was shorter than expected) 
    17261726 *
    17271727 * @param WP_Post $post
    17281728 */
     1729
    17291730function _post_states($post) {
     1731        $context = 'post_status';
    17301732        $post_states = array();
    17311733        if ( isset( $_REQUEST['post_status'] ) )
    17321734                $post_status = $_REQUEST['post_status'];
     
    17341737                $post_status = '';
    17351738
    17361739        if ( !empty($post->post_password) )
    1737                 $post_states['protected'] = __('Password protected');
     1740                $post_states['protected'] = _x('Password protected', $context);
    17381741        if ( 'private' == $post->post_status && 'private' != $post_status )
    1739                 $post_states['private'] = __('Private');
     1742                $post_states['private'] = _x('Private', $context);
    17401743        if ( 'draft' === $post->post_status ) {
    17411744                if ( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
    1742                         $post_states[] = __( 'Customization Draft' );
     1745                        $post_states[] = _x( 'Customization Draft', $context );
    17431746                } elseif ( 'draft' !== $post_status ) {
    1744                         $post_states['draft'] = __( 'Draft' );
     1747                        $post_states['draft'] = _x( 'Draft', $context );
    17451748                }
    17461749        } elseif ( 'trash' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
    1747                 $post_states[] = __( 'Customization Draft' );
     1750                $post_states[] = _x( 'Customization Draft', $context );
    17481751        }
    17491752        if ( 'pending' == $post->post_status && 'pending' != $post_status )
    1750                 $post_states['pending'] = _x('Pending', 'post status');
     1753                $post_states['pending'] = _x('Pending', $context);
    17511754        if ( is_sticky($post->ID) )
    1752                 $post_states['sticky'] = __('Sticky');
     1755                $post_states['sticky'] = _x('Sticky', $context);
    17531756
    17541757        if ( 'future' === $post->post_status ) {
    1755                 $post_states['scheduled'] = __( 'Scheduled' );
     1758                $post_states['scheduled'] = _x( 'Scheduled', $context );
    17561759        }
    17571760
    17581761        if ( 'page' === get_option( 'show_on_front' ) ) {
    17591762                if ( intval( get_option( 'page_on_front' ) ) === $post->ID ) {
    1760                         $post_states['page_on_front'] = __( 'Front Page' );
     1763                        $post_states['page_on_front'] = _x( 'Front Page', $context );
    17611764                }
    17621765
    17631766                if ( intval( get_option( 'page_for_posts' ) ) === $post->ID ) {
    1764                         $post_states['page_for_posts'] = __( 'Posts Page' );
     1767                        $post_states['page_for_posts'] = _x( 'Posts Page', $context );
    17651768                }
    17661769        }
     1770
    17671771        /**
    17681772         * Filters the default post display states used in the posts list table.
    17691773         *