Ticket #14981: 14981.4.patch
File 14981.4.patch, 14.9 KB (added by , 8 years ago) |
---|
-
src/wp-admin/includes/ajax-actions.php
1776 1776 $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' ); 1777 1777 $alt = ( 'alternate' == $alt ) ? '' : 'alternate'; 1778 1778 1779 switch ( $post->post_status ) { 1780 case 'publish' : 1781 case 'private' : 1782 $stat = __('Published'); 1783 break; 1784 case 'future' : 1785 $stat = __('Scheduled'); 1786 break; 1787 case 'pending' : 1788 $stat = __('Pending Review'); 1789 break; 1790 case 'draft' : 1791 $stat = __('Draft'); 1792 break; 1793 } 1779 $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) ); 1780 1781 if ( 'private' === $post->post_status ) { 1782 $stat = $post_type_labels->publish['singular']; 1783 } else { 1784 $stat = $post_type_labels->{$post->post_status}['singular']; 1785 } 1794 1786 1795 1787 if ( '0000-00-00 00:00:00' == $post->post_date ) { 1796 1788 $time = ''; -
src/wp-admin/includes/class-wp-posts-list-table.php
278 278 $all_args = array( 'post_type' => $post_type ); 279 279 $mine = ''; 280 280 281 $post_type_labels = get_post_type_labels( get_post_type_object( $post_type ) ); 282 281 283 // Subtract post types that are not included in the admin all list. 282 284 foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) { 283 285 $total_posts -= $num_posts->$state; … … 294 296 ); 295 297 296 298 $mine_inner_html = sprintf( 297 _nx( 298 'Mine <span class="count">(%s)</span>', 299 'Mine <span class="count">(%s)</span>', 300 $this->user_posts_count, 301 'posts' 302 ), 299 translate_nooped_plural( $post_type_labels->mine, $this->user_posts_count ) . ' <span class="count">(%s)</span>', 303 300 number_format_i18n( $this->user_posts_count ) 304 301 ); 305 302 … … 314 311 } 315 312 316 313 $all_inner_html = sprintf( 317 _nx( 318 'All <span class="count">(%s)</span>', 319 'All <span class="count">(%s)</span>', 320 $total_posts, 321 'posts' 322 ), 314 translate_nooped_plural( $post_type_labels->all, $total_posts ), 323 315 number_format_i18n( $total_posts ) 324 316 ); 325 317 … … 347 339 ); 348 340 349 341 $status_label = sprintf( 350 translate_nooped_plural( $ status->label_count, $num_posts->$status_name ),342 translate_nooped_plural( $post_type_labels->{$status_name}, $num_posts->$status_name ) . ' <span class="count">(%s)</span>', 351 343 number_format_i18n( $num_posts->$status_name ) 352 344 ); 353 345 … … 363 355 ); 364 356 365 357 $sticky_inner_html = sprintf( 366 _nx( 367 'Sticky <span class="count">(%s)</span>', 368 'Sticky <span class="count">(%s)</span>', 369 $this->sticky_posts_count, 370 'posts' 371 ), 358 translate_nooped_plural( $post_type_labels->sticky, $this->sticky_posts_count ) . ' <span class="count">(%s)</span>', 372 359 number_format_i18n( $this->sticky_posts_count ) 373 360 ); 374 361 … … 991 978 } 992 979 } 993 980 981 $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) ); 994 982 if ( 'publish' === $post->post_status ) { 995 _e( 'Published' );983 echo $post_type_labels->publish['singular']; 996 984 } elseif ( 'future' === $post->post_status ) { 997 985 if ( $time_diff > 0 ) { 998 986 echo '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>'; 999 987 } else { 1000 _e( 'Scheduled' );988 echo $post_type_labels->future['singular']; 1001 989 } 1002 990 } else { 1003 991 _e( 'Last Modified' ); … … 1618 1606 <?php endif; ?> 1619 1607 </div> 1620 1608 1621 <?php endif; // $bulk 1622 endif; // post_type_supports comments or pings ?> 1609 <?php 1610 endif; // $bulk 1611 endif; // post_type_supports comments or pings 1612 $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) ); 1613 ?> 1623 1614 1624 1615 <div class="inline-edit-group wp-clearfix"> 1625 1616 <label class="inline-edit-status alignleft"> … … 1629 1620 <option value="-1"><?php _e( '— No Change —' ); ?></option> 1630 1621 <?php endif; // $bulk ?> 1631 1622 <?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?> 1632 <option value="publish"><?php _e( 'Published' ); ?></option>1633 <option value="future"><?php _e( 'Scheduled' ); ?></option>1623 <option value="publish"><?php echo $post_type_labels->publish['singular']; ?></option> 1624 <option value="future"><?php echo $post_type_labels->future['singular']; ?></option> 1634 1625 <?php if ( $bulk ) : ?> 1635 <option value="private"><?php _e( 'Private' )?></option>1626 <option value="private"><?php echo $post_type_labels->private['singular']; ?></option> 1636 1627 <?php endif; // $bulk ?> 1637 1628 <?php endif; ?> 1638 <option value="pending"><?php _e( 'Pending Review' ); ?></option>1639 <option value="draft"><?php _e( 'Draft' ); ?></option>1629 <option value="pending"><?php echo $post_type_labels->pending['singular']; ?></option> 1630 <option value="draft"><?php echo $post_type_labels->draft['singular']; ?></option> 1640 1631 </select> 1641 1632 </label> 1642 1633 -
src/wp-admin/includes/meta-boxes.php
75 75 <div id="misc-publishing-actions"> 76 76 77 77 <div class="misc-pub-section misc-pub-post-status"> 78 <?php _e( 'Status:' ) ?> <span id="post-status-display"><?php 79 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; 97 } 78 <?php _e( 'Status:' ) ?> <span id="post-status-display"> 79 <?php 80 $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) ); 81 if ( 'auto-draft' === $post->post_status ) { 82 echo $post_type_labels->draft['singular']; 83 } else { 84 echo $post_type_labels->{$post->post_status}['singular']; 85 } 98 86 ?> 99 87 </span> 100 88 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> … … 105 93 <label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ) ?></label> 106 94 <select name="post_status" id="post_status"> 107 95 <?php if ( 'publish' == $post->post_status ) : ?> 108 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published')?></option>96 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php echo $post_type_labels->publish['singular']; ?></option> 109 97 <?php elseif ( 'private' == $post->post_status ) : ?> 110 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published')?></option>98 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php echo $post_type_labels->private['singular']; ?></option> 111 99 <?php elseif ( 'future' == $post->post_status ) : ?> 112 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled')?></option>100 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php echo $post_type_labels->future['singular']; ?></option> 113 101 <?php endif; ?> 114 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review')?></option>102 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php echo $post_type_labels->pending['singular']; ?></option> 115 103 <?php if ( 'auto-draft' == $post->post_status ) : ?> 116 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft')?></option>104 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php echo $post_type_labels->draft['singular']; ?></option> 117 105 <?php else : ?> 118 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft')?></option>106 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php echo $post_type_labels->draft['singular']; ?></option> 119 107 <?php endif; ?> 120 108 </select> 121 109 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> -
src/wp-admin/includes/nav-menu.php
390 390 '_wpnonce', 391 391 ); 392 392 393 $post_type_labels = get_post_type_labels( get_post_type_object( $post_type_name ) ); 394 393 395 ?> 394 396 <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv"> 395 397 <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs"> 396 398 <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>> 397 399 <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"> 398 <?php _e( 'Most Recent' ); ?>400 <?php echo $post_type_labels->most_recent; ?> 399 401 </a> 400 402 </li> 401 403 <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>> 402 404 <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"> 403 <?php _e( 'View All' ); ?>405 <?php echo $post_type_labels->view_all; ?> 404 406 </a> 405 407 </li> 406 408 <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>> 407 409 <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"> 408 <?php _e( 'Search'); ?>410 <?php echo $post_type_labels->search; ?> 409 411 </a> 410 412 </li> 411 413 </ul><!-- .posttype-tabs --> -
src/wp-admin/includes/template.php
1697 1697 else 1698 1698 $post_status = ''; 1699 1699 1700 $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) ); 1701 1700 1702 if ( !empty($post->post_password) ) 1701 1703 $post_states['protected'] = __('Password protected'); 1702 1704 if ( 'private' == $post->post_status && 'private' != $post_status ) 1703 $post_states['private'] = __('Private');1705 $post_states['private'] = $post_type_labels->private['singular']; 1704 1706 if ( 'draft' == $post->post_status && 'draft' != $post_status ) 1705 $post_states['draft'] = __('Draft');1707 $post_states['draft'] = $post_type_labels->draft['singular']; 1706 1708 if ( 'pending' == $post->post_status && 'pending' != $post_status ) 1707 $post_states['pending'] = _x('Pending', 'post status');1709 $post_states['pending'] = $post_type_labels->pending['singular']; 1708 1710 if ( is_sticky($post->ID) ) 1709 $post_states['sticky'] = __('Sticky');1711 $post_states['sticky'] = $post_type_labels->sticky['singular']; 1710 1712 1711 1713 if ( 'future' === $post->post_status ) { 1712 $post_states[' scheduled'] = __( 'Scheduled' );1714 $post_states['future'] = $post_type_labels->future['singular']; 1713 1715 } 1714 1716 1715 1717 if ( 'page' === get_option( 'show_on_front' ) ) { -
src/wp-includes/post.php
1346 1346 * - `items_list_navigation` - Label for the table pagination hidden heading. Default is 'Posts list navigation' / 1347 1347 * 'Pages list navigation'. 1348 1348 * - `items_list` - Label for the table hidden heading. Default is 'Posts list' / 'Pages list'. 1349 * - 1350 * - `most_recent` - Label for for "most recent" menu filter. Default is 'Most Recent' / 'Most Recent' 1351 * - `view_all` - Label for for "view all" menu filter. Default is 'View All' / 'View All' 1352 * - `search` - Label for for "search" menu filter. Default is 'Search' / 'Search' 1353 * - `publish` - Label for Post Status string. Default is 'Published' / 'Published' 1354 * - `future` - Label for Post Status string. Default is 'Scheduled' / 'Scheduled' 1355 * - `draft` - Label for Post Status string. Default is 'Draft' / 'Draft' 1356 * - `pending` - Label for Post Status string. Default is 'Pending Review' / 'Pending Review' 1357 * - `private` - Label for Post Status string. Default is 'Privately Published' / 'Privately Published' 1358 * - `trash` - Label for Post Status string. Default is 'Trash' / 'Trash' 1359 * - `mine` - Label for for use in getting post table views string. Default is 'Mine' / 'Mine' 1360 * - `all` - Label for for use in getting post table views string. Default is 'All <span class="count">(%s)</span>' / 'All <span class="count">(%s)</span>' 1361 * - `sticky` - Label for for use in getting post table views string. Default is 'Sticky' / 'Sticky' 1349 1362 * 1350 1363 * Above, the first default value is for non-hierarchical post types (like posts) 1351 1364 * and the second one is for hierarchical post types (like pages). … … 1391 1404 'filter_items_list' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ), 1392 1405 'items_list_navigation' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ), 1393 1406 'items_list' => array( __( 'Posts list' ), __( 'Pages list' ) ), 1407 'most_recent' => array( _x( 'Most Recent', 'post' ), _x( 'Most Recent', 'page' ) ), 1408 'view_all' => array( _x( 'View All', 'post' ), _x( 'View All', 'page' ) ), 1409 'search' => array( _x( 'Search', 'post' ), _x( 'Search', 'page' ) ), 1410 'publish' => array( _nx_noop( 'Published', 'Published', 'post' ), _nx_noop( 'Published', 'Published', 'page' ) ), 1411 'future' => array( _nx_noop( 'Scheduled', 'Scheduled', 'post' ), _nx_noop( 'Scheduled', 'Scheduled', 'page' ) ), 1412 'draft' => array( _nx_noop( 'Draft', 'Draft', 'post' ), _nx_noop( 'Draft', 'Draft', 'page' ) ), 1413 'pending' => array( _nx_noop( 'Pending Review', 'Pending Review', 'post' ), _nx_noop( 'Pending Review', 'Pending Review', 'page' ) ), 1414 'private' => array( _nx_noop( 'Privately Published', 'Privately Published', 'post' ), _nx_noop( 'Privately Published', 'Privately Published', 'page' ) ), 1415 'trash' => array( _nx_noop( 'Trash', 'Trash', 'post' ), _nx_noop( 'Trash', 'Trash', 'page' ) ), 1416 'mine' => array( _nx_noop( 'Mine', 'Mine', 'post' ), _nx_noop( 'Mine', 'Mine', 'page' ) ), 1417 'all' => array( _nx_noop( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', 'post' ), _nx_noop( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', 'page' ) ), 1418 'sticky' => array( _nx_noop( 'Sticky', 'Sticky', 'post' ), null ), 1394 1419 ); 1395 1420 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1396 1421