- $submenu['edit-pages.php'][10] = array( _x('Add New', 'page'), 'edit_pages', 'page-new.php' );
-
-$menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div' );
-
-$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group
-
-$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
-
-$menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top', 'menu-appearance', 'div' );
- $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
- $submenu['themes.php'][10] = array(__('Editor'), 'edit_themes', 'theme-editor.php');
- $submenu['themes.php'][15] = array(__('Add New Themes'), 'install_themes', 'theme-install.php');
-
-$update_plugins = get_transient( 'update_plugins' );
-$update_count = 0;
-if ( !empty($update_plugins->response) )
- $update_count = count( $update_plugins->response );
-
-$menu[65] = array( sprintf( __('Plugins %s'), "<span class='update-plugins count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php', '', 'menu-top', 'menu-plugins', 'div' );
- $submenu['plugins.php'][5] = array( __('Installed'), 'activate_plugins', 'plugins.php' );
- /* translators: add new plugin */
- $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php');
- $submenu['plugins.php'][15] = array( __('Editor'), 'edit_plugins', 'plugin-editor.php' );
+ $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), get_post_type_object( 'page' )->cap->create_posts, 'post-new.php?post_type=page' );
+ $i = 15;
+ foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
+ if ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array('page', (array) $tax->object_type, true) )
+ continue;