Taxonomy: After [40984], add the `most_used` label for non-hierarchical taxonomies too, and use it on the Menus screen.
Props johnbillion. Fixes #41150. Built from https://develop.svn.wordpress.org/trunk@41987 git-svn-id: http://core.svn.wordpress.org/trunk@41821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ffddfb573b
commit
654386a5b7
|
@ -998,7 +998,7 @@ function link_categories_meta_box($link) {
|
||||||
<div id="taxonomy-linkcategory" class="categorydiv">
|
<div id="taxonomy-linkcategory" class="categorydiv">
|
||||||
<ul id="category-tabs" class="category-tabs">
|
<ul id="category-tabs" class="category-tabs">
|
||||||
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
|
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
|
||||||
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
|
<li class="hide-if-no-js"><a href="#categories-pop"><?php _ex( 'Most Used', 'categories' ); ?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="categories-all" class="tabs-panel">
|
<div id="categories-all" class="tabs-panel">
|
||||||
|
|
|
@ -607,6 +607,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
|
||||||
function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
|
function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
|
||||||
global $nav_menu_selected_id;
|
global $nav_menu_selected_id;
|
||||||
$taxonomy_name = $box['args']->name;
|
$taxonomy_name = $box['args']->name;
|
||||||
|
$taxonomy = get_taxonomy( $taxonomy_name );
|
||||||
|
|
||||||
// Paginate browsing for large numbers of objects.
|
// Paginate browsing for large numbers of objects.
|
||||||
$per_page = 50;
|
$per_page = 50;
|
||||||
|
@ -682,7 +683,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
|
||||||
<ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
|
<ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
|
||||||
<li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
<li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
||||||
<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">
|
<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">
|
||||||
<?php _e( 'Most Used' ); ?>
|
<?php echo esc_html( $taxonomy->labels->most_used ); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
||||||
|
|
|
@ -488,8 +488,7 @@ function unregister_taxonomy( $taxonomy ) {
|
||||||
* list tables.
|
* list tables.
|
||||||
* @type string $items_list_navigation Label for the table pagination hidden heading.
|
* @type string $items_list_navigation Label for the table pagination hidden heading.
|
||||||
* @type string $items_list Label for the table hidden heading.
|
* @type string $items_list Label for the table hidden heading.
|
||||||
* @type string $most_used Title used for the Most Used panel. Not used for non-hierarchical
|
* @type string $most_used Title for the Most Used tab. Default 'Most Used'.
|
||||||
* taxonomies. Default 'Most Used'.
|
|
||||||
* @type string $back_to_items Label displayed after a term has been updated.
|
* @type string $back_to_items Label displayed after a term has been updated.
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
@ -523,7 +522,7 @@ function get_taxonomy_labels( $tax ) {
|
||||||
'items_list_navigation' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ),
|
'items_list_navigation' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ),
|
||||||
'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ),
|
'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ),
|
||||||
/* translators: Tab heading when selecting from the most used terms */
|
/* translators: Tab heading when selecting from the most used terms */
|
||||||
'most_used' => array( null, _x( 'Most Used', 'Most used categories' ) ),
|
'most_used' => array( _x( 'Most Used', 'tags' ), _x( 'Most Used', 'categories' ) ),
|
||||||
'back_to_items' => array( __( '← Back to Tags' ), __( '← Back to Categories' ) ),
|
'back_to_items' => array( __( '← Back to Tags' ), __( '← Back to Categories' ) ),
|
||||||
);
|
);
|
||||||
$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
|
$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.9-beta3-41986';
|
$wp_version = '4.9-beta3-41987';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue