From 7996e87f38f129413102557020457189d0548b63 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 25 Dec 2021 03:17:04 +0000 Subject: [PATCH] Toolbar: Show the Customize link on front end when using a block theme if any plugins use the Customizer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In WordPress 5.9, when a block theme is being used, the `Appearance → Customize` admin menu item is not present unless a plugin uses the Customizer. The Customize admin bar node should be shown on the front end if any plugins are using the Customizer, even if the current theme is a block theme. This commit mirrors a similar check in the admin menu to determine if the Customize link should be displayed. Follow-up to [52069], [52134], [52158], [52178]. Props pbiron, audrasjb, sabernhardt, costdev. Fixes #54683. Built from https://develop.svn.wordpress.org/trunk@52414 git-svn-id: http://core.svn.wordpress.org/trunk@52006 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index fa2017a501..18ca17b5fa 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -446,8 +446,8 @@ function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { function wp_admin_bar_customize_menu( $wp_admin_bar ) { global $wp_customize; - // Don't show if a block theme is activated. - if ( wp_is_block_theme() ) { + // Don't show if a block theme is activated and no plugins use the customizer. + if ( wp_is_block_theme() && ! has_action( 'customize_register' ) ) { return; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 1b3b43ff97..962c95d882 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta4-52413'; +$wp_version = '5.9-beta4-52414'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.