Make WordPress Core

Changeset 41987


Ignore:
Timestamp:
10/24/2017 11:21:47 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Taxonomy: After [40984], add the most_used label for non-hierarchical taxonomies too, and use it on the Menus screen.

Props johnbillion.
Fixes #41150.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/meta-boxes.php

    r41910 r41987  
    999999    <ul id="category-tabs" class="category-tabs">
    10001000        <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
    1001         <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
     1001        <li class="hide-if-no-js"><a href="#categories-pop"><?php _ex( 'Most Used', 'categories' ); ?></a></li>
    10021002    </ul>
    10031003
  • trunk/src/wp-admin/includes/nav-menu.php

    r41941 r41987  
    608608    global $nav_menu_selected_id;
    609609    $taxonomy_name = $box['args']->name;
     610    $taxonomy = get_taxonomy( $taxonomy_name );
    610611
    611612    // Paginate browsing for large numbers of objects.
     
    683684            <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
    684685                <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop">
    685                     <?php _e( 'Most Used' ); ?>
     686                    <?php echo esc_html( $taxonomy->labels->most_used ); ?>
    686687                </a>
    687688            </li>
  • trunk/src/wp-includes/taxonomy.php

    r41809 r41987  
    489489 *     @type string $items_list_navigation      Label for the table pagination hidden heading.
    490490 *     @type string $items_list                 Label for the table hidden heading.
    491  *     @type string $most_used                  Title used for the Most Used panel. Not used for non-hierarchical
    492  *                                              taxonomies. Default 'Most Used'.
     491 *     @type string $most_used                  Title for the Most Used tab. Default 'Most Used'.
    493492 *     @type string $back_to_items              Label displayed after a term has been updated.
    494493 * }
     
    524523        'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ),
    525524        /* translators: Tab heading when selecting from the most used terms */
    526         'most_used' => array( null, _x( 'Most Used', 'Most used categories' ) ),
     525        'most_used' => array( _x( 'Most Used', 'tags' ), _x( 'Most Used', 'categories' ) ),
    527526        'back_to_items' => array( __( '&larr; Back to Tags' ), __( '&larr; Back to Categories' ) ),
    528527    );
Note: See TracChangeset for help on using the changeset viewer.