Themes: Improve Gutenberg check before activating an FSE theme.

Account for sites enabling Gutenberg as an mu-plugin when determining whether full-site-editing themes can be enabled. This replaces the check the plugin is active with a check whether the function `gutenberg_is_fse_theme()` is defined.

Follow up to [51193].

Props noisysocks, peterwilsoncc, SergeyBiryukov.
See #53410.


Built from https://develop.svn.wordpress.org/trunk@51197


git-svn-id: http://core.svn.wordpress.org/trunk@50806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2021-06-22 05:56:57 +00:00
parent e84cfe850d
commit 0d8727bec8
3 changed files with 3 additions and 3 deletions

View File

@ -189,7 +189,7 @@ do_action( 'customize_controls_head' );
// Check if the theme requires the FSE to work correctly.
$theme_tags = $wp_customize->theme()->get( 'Tags' );
if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! function_exists( 'gutenberg_is_fse_theme' ) ) {
$fse_safe = false;
}
?>

View File

@ -911,7 +911,7 @@ function validate_theme_requirements( $stylesheet ) {
// If the theme is a Full Site Editing theme, check for the presence of the Gutenberg plugin.
$theme_tags = $theme->get( 'Tags' );
if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! function_exists( 'gutenberg_is_fse_theme' ) ) {
return new WP_Error(
'theme_requires_fse',
sprintf(

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-beta2-51196';
$wp_version = '5.8-beta2-51197';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.