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
This commit is contained in:
nacin 2010-11-09 02:09:00 +00:00
parent c3b6ef86ea
commit 91d3b6bea9
3 changed files with 8 additions and 6 deletions

View File

@ -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);

View File

@ -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 );
}

View File

@ -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 );
}