From edf755823ba24030f3b636c5bcdf002632451e18 Mon Sep 17 00:00:00 2001
From: hellofromTonya
Date: Tue, 14 Dec 2021 15:33:01 +0000
Subject: [PATCH] Customize: Overlay incompatible banner for block themes.
Starting in 5.9, block themes are not compatible with (do not support) Customizer; rather, they use the Site Editor. Viewing installed themes in Customizer, this commit adds an overlay message to alert users and give them a way to activate the block theme. Clicking on the "Activate" button activates the block theme and redirects back to the Appearance > Themes interface, where the user can then enter the Site Editor for customization.
Non-block themes are not affected by this change and continue to work in Customizer.
Follow-up to [41648], [41893], [52279].
Props antonvlasenko, costdev, hellofromTonya, jffng, joyously, noisysocks, poena, shaunandrews.
Fixes #54549.
Built from https://develop.svn.wordpress.org/trunk@52371
git-svn-id: http://core.svn.wordpress.org/trunk@51963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-admin/includes/theme.php | 31 ++++++++++--
wp-includes/class-wp-customize-manager.php | 9 ++--
.../class-wp-customize-theme-control.php | 50 +++++++++++++++----
wp-includes/version.php | 2 +-
4 files changed, 74 insertions(+), 18 deletions(-)
diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php
index 1e4828b3c1..8e98854afc 100644
--- a/wp-admin/includes/theme.php
+++ b/wp-admin/includes/theme.php
@@ -1005,6 +1005,21 @@ function customize_themes_print_templates() {
?>
<# } #>
+
+ <# if ( data.actions.activate ) { #>
+ activate this theme, and use the Site Editor to customize it.' ),
+ '{{{ data.actions.activate }}}'
+ );
+ ?>
+ <# } #>
+
+
+ <# if ( data.theme.actions.activate ) { #>
+ activate this theme, and use the Site Editor to customize it.' ),
+ '{{{ data.theme.actions.activate }}}'
+ );
+ ?>
+ <# } #>
+
diff --git a/wp-includes/version.php b/wp-includes/version.php
index cf5fb84914..6d6cb89f1b 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.9-beta2-52370';
+$wp_version = '5.9-beta2-52371';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.