Skip to content

Commit 098ab59

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51197 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d920d56 commit 098ab59

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-admin/customize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
// Check if the theme requires the FSE to work correctly.
190190
$theme_tags = $wp_customize->theme()->get( 'Tags' );
191191

192-
if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
192+
if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! function_exists( 'gutenberg_is_fse_theme' ) ) {
193193
$fse_safe = false;
194194
}
195195
?>

src/wp-includes/theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ function validate_theme_requirements( $stylesheet ) {
911911
// If the theme is a Full Site Editing theme, check for the presence of the Gutenberg plugin.
912912
$theme_tags = $theme->get( 'Tags' );
913913

914-
if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
914+
if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! function_exists( 'gutenberg_is_fse_theme' ) ) {
915915
return new WP_Error(
916916
'theme_requires_fse',
917917
sprintf(

0 commit comments

Comments
 (0)