diff --git a/wp-admin/customize.php b/wp-admin/customize.php index f2eb07e9b5..fdbc7f7b9e 100644 --- a/wp-admin/customize.php +++ b/wp-admin/customize.php @@ -184,8 +184,16 @@ do_action( 'customize_controls_head' ); theme()->get( 'RequiresWP' ) ); $compatible_php = is_php_version_compatible( $wp_customize->theme()->get( 'RequiresPHP' ) ); + $fse_safe = true; + + // 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' ) ) { + $fse_safe = false; + } ?> - + is_theme_active() ? __( 'Publish' ) : __( 'Activate & Publish' ); ?>
diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 7d4b62684b..cbf1849d21 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -908,6 +908,20 @@ function validate_current_theme() { function validate_theme_requirements( $stylesheet ) { $theme = wp_get_theme( $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' ) ) { + return new WP_Error( + 'theme_requires_fse', + sprintf( + /* translators: %s: Theme name. */ + _x( 'Error: This theme (%s) uses Full Site Editing, which requires the Gutenberg plugin to be activated.', 'theme' ), + $theme->display( 'Name' ) + ) + ); + } + $requirements = array( 'requires' => ! empty( $theme->get( 'RequiresWP' ) ) ? $theme->get( 'RequiresWP' ) : '', 'requires_php' => ! empty( $theme->get( 'RequiresPHP' ) ) ? $theme->get( 'RequiresPHP' ) : '', diff --git a/wp-includes/version.php b/wp-includes/version.php index a3553a24a7..4ca1114a43 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta2-51192'; +$wp_version = '5.8-beta2-51193'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.