Ticket #14981: 14981.2.patch
File 14981.2.patch, 12.7 KB (added by , 9 years ago) |
---|
-
wp-admin/includes/ajax-actions.php
1762 1762 $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' ); 1763 1763 $alt = ( 'alternate' == $alt ) ? '' : 'alternate'; 1764 1764 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}['singular']; 1767 if( 'private' == $post->post_status ) { 1768 $stat = $post_type_labels->publish['singular']; 1779 1769 } 1780 1770 1781 1771 if ( '0000-00-00 00:00:00' == $post->post_date ) { -
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 ) . ' <span class="count">(%s)</span>', 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 … … 941 928 } 942 929 } 943 930 931 $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) ); 944 932 if ( 'publish' === $post->post_status ) { 945 _e( 'Published' );933 echo $post_type_labels->publish['singular']; 946 934 } elseif ( 'future' === $post->post_status ) { 947 935 if ( $time_diff > 0 ) { 948 936 echo '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>'; 949 937 } else { 950 _e( 'Scheduled' );938 echo $post_type_labels->future['singular']; 951 939 } 952 940 } else { 953 941 _e( 'Last Modified' ); … … 1526 1514 <?php endif; ?> 1527 1515 </div> 1528 1516 1529 <?php endif; // $bulk 1530 endif; // post_type_supports comments or pings ?> 1517 <?php 1518 endif; // $bulk 1519 endif; // post_type_supports comments or pings 1520 $post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) ); 1521 ?> 1531 1522 1532 1523 <div class="inline-edit-group"> 1533 1524 <label class="inline-edit-status alignleft"> … … 1537 1528 <option value="-1"><?php _e( '— No Change —' ); ?></option> 1538 1529 <?php endif; // $bulk ?> 1539 1530 <?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>1531 <option value="publish"><?php echo $post_type_labels->publish['singular']; ?></option> 1532 <option value="future"><?php echo $post_type_labels->future['singular']; ?></option> 1542 1533 <?php if ( $bulk ) : ?> 1543 <option value="private"><?php _e( 'Private' )?></option>1534 <option value="private"><?php echo $post_type_labels->private['singular']; ?></option> 1544 1535 <?php endif; // $bulk ?> 1545 1536 <?php endif; ?> 1546 <option value="pending"><?php _e( 'Pending Review' ); ?></option>1547 <option value="draft"><?php _e( 'Draft' ); ?></option>1537 <option value="pending"><?php echo $post_type_labels->pending['singular']; ?></option> 1538 <option value="draft"><?php echo $post_type_labels->draft['singular']; ?></option> 1548 1539 </select> 1549 1540 </label> 1550 1541 -
wp-admin/includes/meta-boxes.php
77 77 <div class="misc-pub-section misc-pub-post-status"><label for="post_status"><?php _e('Status:') ?></label> 78 78 <span id="post-status-display"> 79 79 <?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 ) ); 81 if( 'auto-draft' == $post->post_status ) { 82 echo $post_type_labels->publish['singular']; 83 } else { 84 echo $post_type_labels->{$post->post_status}['singular']; 97 85 } 98 86 ?> 99 87 </span> … … 104 92 <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); ?>" /> 105 93 <select name='post_status' id='post_status'> 106 94 <?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['singular']; ?></option> 108 96 <?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['singular']; ?></option> 110 98 <?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['singular']; ?></option> 112 100 <?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['singular']; ?></option> 114 102 <?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['singular']; ?></option> 116 104 <?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['singular']; ?></option> 118 106 <?php endif; ?> 119 107 </select> 120 108 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> -
wp-admin/includes/nav-menu.php
374 374 '_wpnonce', 375 375 ); 376 376 377 $post_type_labels = get_post_type_labels( get_post_type_object( $post_type_name ) ); 378 377 379 ?> 378 380 <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv"> 379 381 <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs"> 380 382 <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>> 381 383 <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' ); ?>384 <?php echo $post_type_labels->most_recent; ?> 383 385 </a> 384 386 </li> 385 387 <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>> 386 388 <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' ); ?>389 <?php echo $post_type_labels->view_all; ?> 388 390 </a> 389 391 </li> 390 392 <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>> 391 393 <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'); ?>394 <?php echo $post_type_labels->search; ?> 393 395 </a> 394 396 </li> 395 397 </ul><!-- .posttype-tabs --> -
wp-includes/post.php
1389 1389 } 1390 1390 } 1391 1391 1392 1392 1393 /** 1393 1394 * Build an object with all post type labels out of a post type object 1394 1395 * … … 1422 1423 * - filter_items_list - String for the table views hidden heading. 1423 1424 * - items_list_navigation - String for the table pagination hidden heading. 1424 1425 * - items_list - String for the table hidden heading. 1426 * - most_recent - String for menu filters. 1427 * - view_all - String for menu filters. 1428 * - search - String for menu filters. 1429 * - publish - Post Status. 1430 * - future - Post Status. 1431 * - draft - Post Status. 1432 * - pending - Post Status. 1433 * - private - Post Status. 1434 * - trash - Post Status. 1435 * - auto_draft - Post Status. 1436 * - mine - String for use in getting post table views. 1437 * - all - String for use in getting post table views. 1438 * - sticky - String for use in getting post table views. 1425 1439 * 1426 1440 * Above, the first default value is for non-hierarchical post types (like posts) 1427 1441 * and the second one is for hierarchical post types (like pages). … … 1461 1475 'filter_items_list' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ), 1462 1476 'items_list_navigation' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ), 1463 1477 'items_list' => array( __( 'Posts list' ), __( 'Pages list' ) ), 1478 'most_recent' => array( _x('Most Recent', 'post'), _x('Most Recent', 'page') ), 1479 'view_all' => array( _x('View All', 'post'), _x('View All', 'page') ), 1480 'search' => array( _x('Search', 'post'), _x('Search', 'page') ), 1481 'publish' => array( _nx_noop( 'Published', 'Published', 'post' ), _nx_noop( 'Published', 'Published', 'page' ) ), 1482 'future' => array( _nx_noop( 'Scheduled', 'Scheduled', 'post' ), _nx_noop( 'Scheduled', 'Scheduled', 'page' ) ), 1483 'draft' => array( _nx_noop( 'Draft', 'Drafts', 'post' ), _nx_noop( 'Draft', 'Drafts', 'page' ) ), 1484 'pending' => array( _nx_noop( 'Pending Review', 'Pending Review', 'post' ), _nx_noop( 'Pending Review', 'Pending Review', 'page' ) ), 1485 'private' => array( _nx_noop( 'Privately Published', 'Privately Published', 'post' ), _nx_noop( 'Privately Published', 'Privately Published', 'page' ) ), 1486 'trash' => array( _nx_noop( 'Trash', 'Trash', 'post' ), _nx_noop( 'Trash', 'Trash', 'page' ) ), 1487 'auto_draft' => array( _nx_noop( 'Auto-Draft', 'Auto-Drafts', 'post' ), _nx_noop( 'Auto-Draft', 'Auto-Drafts', 'page' ) ), 1488 'mine' => array( _nx_noop( 'Mine', 'Mine', 'post' ), null ), 1489 'all' => array( _nx_noop( 'All', 'All', 'post' ), null ), 1490 'sticky' => array(_nx_noop( 'Sticky', 'Stickies', 'post' ), null ), 1464 1491 ); 1465 1492 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1466 1493