mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
More custom post type support. Props scribu. see #9674
git-svn-id: https://develop.svn.wordpress.org/trunk@12597 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -65,6 +65,25 @@ $menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='c
|
||||
|
||||
$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group
|
||||
|
||||
foreach ( (array) get_post_types( array('_show' => true) ) as $ptype ) {
|
||||
$_wp_last_object_menu++;
|
||||
$ptype_obj = get_post_type_object($ptype);
|
||||
$menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), 'edit_' . $ptype_obj->capability_type . 's', "edit.php?post_type=$ptype", '', 'menu-top', 'menu-posts', 'div');
|
||||
$submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), 'edit_posts', "edit.php?post_type=$ptype");
|
||||
/* translators: add new custom post type */
|
||||
$submenu["edit.php?post_type=$ptype"][10] = array( _x('Add New', 'post'), 'edit_posts', "post-new.php?post_type=$ptype" );
|
||||
|
||||
$i = 15;
|
||||
foreach ( $wp_taxonomies as $tax ) {
|
||||
if ( $tax->hierarchical || ! 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" );
|
||||
++$i;
|
||||
}
|
||||
}
|
||||
unset($ptype, $ptype_obj);
|
||||
|
||||
$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
|
||||
|
||||
$menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top', 'menu-appearance', 'div' );
|
||||
|
||||
Reference in New Issue
Block a user