Make WordPress Core

Ticket #14981: 14981.patch

File 14981.patch, 9.5 KB (added by rockwell15, 9 years ago)

Patch for #14981

  • wp-admin/includes/ajax-actions.php

     
    17621762                $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );
    17631763                $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
    17641764
    1765                 switch ( $post->post_status ) {
    1766                         case 'publish' :
    1767                         case 'private' :
    1768                                 $stat = __('Published');
    1769                                 break;
    1770                         case 'future' :
    1771                                 $stat = __('Scheduled');
    1772                                 break;
    1773                         case 'pending' :
    1774                                 $stat = __('Pending Review');
    1775                                 break;
    1776                         case 'draft' :
    1777                                 $stat = __('Draft');
    1778                                 break;
     1765                $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) );
     1766                $stat = $post_type_labels->{$post->post_status};
     1767                if( $post->post_status == 'private' ) {
     1768                        $stat = $post_type_labels->publish;
    17791769                }
    17801770
    17811771                if ( '0000-00-00 00:00:00' == $post->post_date ) {
  • wp-admin/includes/class-wp-posts-list-table.php

     
    941941                        }
    942942                }
    943943
     944                $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) );
    944945                if ( 'publish' === $post->post_status ) {
    945                         _e( 'Published' );
     946                        echo $post_type_labels->publish;
    946947                } elseif ( 'future' === $post->post_status ) {
    947948                        if ( $time_diff > 0 ) {
    948949                                echo '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
    949950                        } else {
    950                                 _e( 'Scheduled' );
     951                                echo $post_type_labels->future;
    951952                        }
    952953                } else {
    953954                        _e( 'Last Modified' );
     
    15261527                        <?php endif; ?>
    15271528                        </div>
    15281529
    1529         <?php endif; // $bulk
    1530         endif; // post_type_supports comments or pings ?>
     1530        <?php
     1531                endif; // $bulk
     1532        endif; // post_type_supports comments or pings
     1533        $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) );
     1534        ?>
    15311535
    15321536                        <div class="inline-edit-group">
    15331537                                <label class="inline-edit-status alignleft">
     
    15371541                                                <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
    15381542        <?php endif; // $bulk ?>
    15391543                                        <?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?>
    1540                                                 <option value="publish"><?php _e( 'Published' ); ?></option>
    1541                                                 <option value="future"><?php _e( 'Scheduled' ); ?></option>
     1544                                                <option value="publish"><?php echo $post_type_labels->publish; ?></option>
     1545                                                <option value="future"><?php echo $post_type_labels->future; ?></option>
    15421546        <?php if ( $bulk ) : ?>
    1543                                                 <option value="private"><?php _e( 'Private' ) ?></option>
     1547                                                <option value="private"><?php echo $post_type_labels->private; ?></option>
    15441548        <?php endif; // $bulk ?>
    15451549                                        <?php endif; ?>
    1546                                                 <option value="pending"><?php _e( 'Pending Review' ); ?></option>
    1547                                                 <option value="draft"><?php _e( 'Draft' ); ?></option>
     1550                                                <option value="pending"><?php echo $post_type_labels->pending; ?></option>
     1551                                                <option value="draft"><?php echo $post_type_labels->draft; ?></option>
    15481552                                        </select>
    15491553                                </label>
    15501554
  • wp-admin/includes/meta-boxes.php

     
    7777<div class="misc-pub-section misc-pub-post-status"><label for="post_status"><?php _e('Status:') ?></label>
    7878<span id="post-status-display">
    7979<?php
    80 switch ( $post->post_status ) {
    81         case 'private':
    82                 _e('Privately Published');
    83                 break;
    84         case 'publish':
    85                 _e('Published');
    86                 break;
    87         case 'future':
    88                 _e('Scheduled');
    89                 break;
    90         case 'pending':
    91                 _e('Pending Review');
    92                 break;
    93         case 'draft':
    94         case 'auto-draft':
    95                 _e('Draft');
    96                 break;
     80$post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) );
     81if( $post->post_status == 'auto-draft' ) {
     82        echo $post_type_labels->publish;
     83} else {
     84        echo $post_type_labels->{$post->post_status};
    9785}
    9886?>
    9987</span>
     
    10492<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" />
    10593<select name='post_status' id='post_status'>
    10694<?php if ( 'publish' == $post->post_status ) : ?>
    107 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
     95<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php echo $post_type_labels->publish; ?></option>
    10896<?php elseif ( 'private' == $post->post_status ) : ?>
    109 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
     97<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php echo $post_type_labels->private; ?></option>
    11098<?php elseif ( 'future' == $post->post_status ) : ?>
    111 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
     99<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php echo $post_type_labels->future; ?></option>
    112100<?php endif; ?>
    113 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
     101<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php echo $post_type_labels->pending; ?></option>
    114102<?php if ( 'auto-draft' == $post->post_status ) : ?>
    115 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option>
     103<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php echo $post_type_labels->draft; ?></option>
    116104<?php else : ?>
    117 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
     105<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php echo $post_type_labels->draft; ?></option>
    118106<?php endif; ?>
    119107</select>
    120108 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
  • wp-admin/includes/nav-menu.php

     
    379379                <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
    380380                        <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>>
    381381                                <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent">
    382                                         <?php _e( 'Most Recent' ); ?>
     382                                        <?php
     383                                        switch( $post_type_name ) {
     384                                                case 'post':
     385                                                        _ex( 'Most Recent', 'post' );
     386                                                        break;
     387                                                case 'page':
     388                                                        _ex( 'Most Recent', 'page' );
     389                                                        break;
     390                                                default:
     391                                                        _e( 'Most Recent' );
     392                                                        break;
     393                                        }
     394                                        ?>
    383395                                </a>
    384396                        </li>
    385397                        <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
    386398                                <a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all">
    387                                         <?php _e( 'View All' ); ?>
     399                                        <?php
     400                                        switch( $post_type_name ) {
     401                                                case 'post':
     402                                                        _ex( 'View All', 'post' );
     403                                                        break;
     404                                                case 'page':
     405                                                        _ex( 'View All', 'page' );
     406                                                        break;
     407                                                default:
     408                                                        _e( 'View All' );
     409                                                        break;
     410                                        }
     411                                        ?>
    388412                                </a>
    389413                        </li>
    390414                        <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
    391415                                <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
    392                                         <?php _e( 'Search'); ?>
     416                                        <?php
     417                                        switch( $post_type_name ) {
     418                                                case 'post':
     419                                                        _ex( 'Search', 'post' );
     420                                                        break;
     421                                                case 'page':
     422                                                        _ex( 'Search', 'page' );
     423                                                        break;
     424                                                default:
     425                                                        _e( 'Search' );
     426                                                        break;
     427                                        }
     428                                        ?>
    393429                                </a>
    394430                        </li>
    395431                </ul><!-- .posttype-tabs -->
  • wp-includes/post.php

     
    13791379                'filter_items_list' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ),
    13801380                'items_list_navigation' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ),
    13811381                'items_list' => array( __( 'Posts list' ), __( 'Pages list' ) ),
     1382
     1383                'publish' => array( _x('Published', 'post'), _x('Published', 'page') ),
     1384                'future' => array( _x('Scheduled', 'post'), _x('Scheduled', 'page') ),
     1385                'draft' => array( _x('Draft', 'post'), _x('Draft', 'page') ),
     1386                'pending' => array( _x('Pending Review', 'post'), _x('Pending Review', 'page') ),
     1387                'private' => array( _x('Privately Published', 'post'), _x('Privately Published', 'page') ),
     1388                'trash' => array( _x('Trash', 'post'), _x('Trash', 'page') ),
     1389                'auto-draft' => array( _x('Auto-Draft', 'post'), _x('Auto-Draft', 'page') )
    13821390        );
    13831391        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    13841392