From 37c8dfc09fc42e6bc0b193800cc9717b08224662 Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Thu, 11 Nov 2021 04:45:22 +0000 Subject: [PATCH] Hide Customize from admin bar when using a block theme Don't add the Customize link to the admin bar when a block theme is activated. See #54337. git-svn-id: https://develop.svn.wordpress.org/trunk@52134 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/admin-bar.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php index ba85e1f1ae..6eca9d05b6 100644 --- a/src/wp-includes/admin-bar.php +++ b/src/wp-includes/admin-bar.php @@ -431,6 +431,11 @@ function wp_admin_bar_customize_menu( $wp_admin_bar ) { return; } + // Don't show if a block theme is activated. + if ( wp_is_block_template_theme() ) { + return; + } + $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if ( is_customize_preview() && $wp_customize->changeset_uuid() ) { $current_url = remove_query_arg( 'customize_changeset_uuid', $current_url );