From 91d3b6bea981cd4fa74df4c019249dbbdbca939c Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 9 Nov 2010 02:09:00 +0000 Subject: [PATCH] Introduce menu_name label for taxonomies and post types. Defaults to name. fixes #14832. git-svn-id: http://svn.automattic.com/wordpress/trunk@16251 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/menu.php | 10 +++++----- wp-includes/post.php | 3 ++- wp-includes/taxonomy.php | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 84c92f61e..8d5a10ccb 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -70,7 +70,7 @@ $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu if ( ! $tax->show_ui || ! in_array('post', (array) $tax->object_type, true) ) continue; - $submenu['edit.php'][$i++] = array( esc_attr( $tax->labels->name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name ); + $submenu['edit.php'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name ); } unset($tax); @@ -94,7 +94,7 @@ $menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'me if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) ) continue; - $submenu['edit.php?post_type=page'][$i++] = array( esc_attr( $tax->labels->name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=page' ); + $submenu['edit.php?post_type=page'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=page' ); } unset($tax); @@ -125,8 +125,8 @@ foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false, while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) ) $ptype_menu_position++; - $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon ); - $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->name, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype"); + $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon ); + $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->menu_name, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype"); $submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->edit_posts, "post-new.php?post_type=$ptype" ); $i = 15; @@ -134,7 +134,7 @@ foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false, if ( ! $tax->show_ui || ! in_array($ptype, (array) $tax->object_type, true) ) continue; - $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr( $tax->labels->name ), $tax->cap->manage_terms, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" ); + $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" ); } } unset($ptype, $ptype_obj, $ptype_class, $ptype_for_id, $ptype_menu_position, $menu_icon, $i); diff --git a/wp-includes/post.php b/wp-includes/post.php index 3951b47cf..061276f29 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1142,8 +1142,9 @@ function get_post_type_labels( $post_type_object ) { 'search_items' => array( __('Search Posts'), __('Search Pages') ), 'not_found' => array( __('No posts found.'), __('No pages found.') ), 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), - 'parent_item_colon' => array( null, __('Parent Page:') ) + 'parent_item_colon' => array( null, __('Parent Page:') ), ); + $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults ); } diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 7ca31154a..da38f049a 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -403,6 +403,7 @@ function get_taxonomy_labels( $tax ) { 'add_or_remove_items' => array( __( 'Add or remove tags' ), null ), 'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ), ); + $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; return _get_custom_object_labels( $tax, $nohier_vs_hier_defaults ); }