diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php index 2a3430ebc3df8..789805d9aae97 100644 --- a/src/wp-admin/menu.php +++ b/src/wp-admin/menu.php @@ -224,31 +224,35 @@ /* translators: %s: Number of available theme updates. */ $submenu['themes.php'][5] = array( sprintf( __( 'Themes %s' ), $count ), $appearance_capability, 'themes.php' ); +if ( ! is_multisite() ) { + $submenu['themes.php'][6] = array( __( 'Add Theme' ), 'install_themes', 'theme-install.php', '', 'hide-if-no-js' ); +} + if ( wp_is_block_theme() ) { - $submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' ); + $submenu['themes.php'][7] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' ); } else { $supports_stylebook = ( current_theme_supports( 'editor-styles' ) || wp_theme_has_theme_json() ); if ( $supports_stylebook ) { - $submenu['themes.php'][6] = array( _x( 'Design', 'design menu item' ), 'edit_theme_options', 'site-editor.php' ); + $submenu['themes.php'][7] = array( _x( 'Design', 'design menu item' ), 'edit_theme_options', 'site-editor.php' ); } else { - $submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?p=/pattern' ); + $submenu['themes.php'][7] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?p=/pattern' ); } } // Font Library menu item. -$submenu['themes.php'][9] = array( __( 'Fonts' ), 'edit_theme_options', 'font-library.php' ); +$submenu['themes.php'][10] = array( __( 'Fonts' ), 'edit_theme_options', 'font-library.php' ); $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' ); // Hide Customize link on block themes unless a plugin or theme // is using 'customize_register' to add a setting. if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) { - $submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); + $submenu['themes.php'][8] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); } if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { - $submenu['themes.php'][10] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ); + $submenu['themes.php'][11] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ); } if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize' ) ) { diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index a611a6819367f..2532b30766ccf 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -26,7 +26,7 @@ $parent_file = 'themes.php'; if ( ! is_network_admin() ) { - $submenu_file = 'themes.php'; + $submenu_file = 'theme-install.php'; } $installed_themes = search_theme_directories(); diff --git a/src/wp-admin/update.php b/src/wp-admin/update.php index a0ba9cfc069b2..c19e64e579fa2 100644 --- a/src/wp-admin/update.php +++ b/src/wp-admin/update.php @@ -283,7 +283,7 @@ // Used in the HTML title tag. $title = __( 'Install Themes' ); $parent_file = 'themes.php'; - $submenu_file = 'themes.php'; + $submenu_file = 'theme-install.php'; require_once ABSPATH . 'wp-admin/admin-header.php'; diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index ff532eee14c43..b56f4986fa9a2 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -5628,7 +5628,7 @@ function wp_widgets_add_menu() { if ( wp_is_block_theme() ) { $submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); } else { - $submenu['themes.php'][8] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); + $submenu['themes.php'][9] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); } ksort( $submenu['themes.php'], SORT_NUMERIC );