diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 97d5f57984..5d550fb55d 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -214,11 +214,12 @@ if ( wp_is_block_theme() ) { ); } -// Hide Customize link on block themes unless a plugin or theme is using -// customize_register to add a setting. +$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' ) ) { - $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_theme() ? 7 : 6; + $position = wp_is_block_theme() ? 7 : 6; $submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); } @@ -237,7 +238,7 @@ if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customi $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' ); } - unset( $customize_url ); +unset( $customize_url ); unset( $appearance_cap ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 962c95d882..5aefbefcde 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta4-52414'; +$wp_version = '5.9-beta4-52415'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.