mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Show custom hierarchical taxonomies in the menus. Props dd32. see #11838
git-svn-id: https://develop.svn.wordpress.org/trunk@12694 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+10
-6
@@ -47,15 +47,16 @@ $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu
|
||||
|
||||
$i = 15;
|
||||
foreach ( $wp_taxonomies as $tax ) {
|
||||
if ( $tax->hierarchical || ! in_array('post', (array) $tax->object_type, true) )
|
||||
if ( ! in_array('post', (array) $tax->object_type, true) )
|
||||
continue;
|
||||
|
||||
$submenu['edit.php'][$i] = array( esc_attr($tax->label), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name );
|
||||
if ( $tax->hierarchical )
|
||||
$submenu['edit.php'][$i] = array( esc_attr($tax->label), 'manage_categories', 'categories.php?taxonomy=' . $tax->name );
|
||||
else
|
||||
$submenu['edit.php'][$i] = array( esc_attr($tax->label), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name );
|
||||
++$i;
|
||||
}
|
||||
|
||||
$submenu['edit.php'][50] = array( __('Categories'), 'manage_categories', 'categories.php' );
|
||||
|
||||
$menu[10] = array( __('Media'), 'upload_files', 'upload.php', '', 'menu-top', 'menu-media', 'div' );
|
||||
$submenu['upload.php'][5] = array( __('Library'), 'upload_files', 'upload.php');
|
||||
/* translators: add new file */
|
||||
@@ -86,10 +87,13 @@ foreach ( (array) get_post_types( array('_show' => true) ) as $ptype ) {
|
||||
|
||||
$i = 15;
|
||||
foreach ( $wp_taxonomies as $tax ) {
|
||||
if ( $tax->hierarchical || ! in_array($ptype, (array) $tax->object_type, true) )
|
||||
if ( ! in_array($ptype, (array) $tax->object_type, true) )
|
||||
continue;
|
||||
|
||||
$submenu["edit.php?post_type=$ptype"][$i] = array( esc_attr($tax->label), 'manage_categories', "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );
|
||||
if ( $tax->hierarchical )
|
||||
$submenu["edit.php?post_type=$ptype"][$i] = array( esc_attr($tax->label), 'manage_categories', "categories.php?taxonomy=$tax->name&post_type=$ptype" );
|
||||
else
|
||||
$submenu["edit.php?post_type=$ptype"][$i] = array( esc_attr($tax->label), 'manage_categories', "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );
|
||||
++$i;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user