From c3222105d83cca007b0e9ab583c9f4ed6643d166 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Tue, 16 Nov 2021 04:43:49 +0000 Subject: [PATCH] Administration: Restores "Customize" menu item for non-block themes and moves for block themes. For themes without non-block themes (i.e. without a `/block-templates/index.html` file), restores the "Customize" menu item under "Appearance" menu to its original location of `6`. For block themes, moves it to position `8`, as "Styles" is in position `7` as of [52158]. Follow-up to [29026], [52069], [52158]. Props poena, davidbaumwald, sabernhardt, hellofromTonya. Fixes #54418. git-svn-id: https://develop.svn.wordpress.org/trunk@52178 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/menu.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php index ece6b59456..e11d293dd2 100644 --- a/src/wp-admin/menu.php +++ b/src/wp-admin/menu.php @@ -223,8 +223,10 @@ if ( wp_is_block_template_theme() ) { // Hide Customize link on block themes unless a plugin or theme is using // customize_register to add a setting. if ( ! wp_is_block_template_theme() || has_action( 'customize_register' ) ) { - $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' ); - $submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); + $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' ); + $position = wp_is_block_template_theme() ? 8 : 6; + + $submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); } if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {