wp/wp-admin/customize.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
--- a/wp/wp-admin/customize.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-admin/customize.php	Wed Sep 21 18:19:35 2022 +0200
@@ -144,6 +144,10 @@
 }
 $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
 
+if ( wp_use_widgets_block_editor() ) {
+	$body_class .= ' wp-embed-responsive';
+}
+
 $admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loading…' ) );
 
 ?>
@@ -184,8 +188,16 @@
 			<?php
 			$compatible_wp  = is_wp_version_compatible( $wp_customize->theme()->get( 'RequiresWP' ) );
 			$compatible_php = is_php_version_compatible( $wp_customize->theme()->get( 'RequiresPHP' ) );
+			$fse_safe       = true;
+
+			// Check if the theme requires the Gutenberg plugin to work correctly.
+			$theme_tags = $wp_customize->theme()->get( 'Tags' );
+
+			if ( ! empty( $theme_tags ) && in_array( 'full-site-editing', $theme_tags, true ) && ! function_exists( 'gutenberg_is_fse_theme' ) ) {
+				$fse_safe = false;
+			}
 			?>
-			<?php if ( $compatible_wp && $compatible_php ) : ?>
+			<?php if ( $compatible_wp && $compatible_php && $fse_safe ) : ?>
 				<?php $save_text = $wp_customize->is_theme_active() ? __( 'Publish' ) : __( 'Activate &amp; Publish' ); ?>
 				<div id="customize-save-button-wrapper" class="customize-save-button-wrapper" >
 					<?php submit_button( $save_text, 'primary save', 'save', false ); ?>
@@ -242,7 +254,7 @@
 		</div>
 
 		<div id="customize-footer-actions" class="wp-full-overlay-footer">
-			<button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php echo esc_attr( _x( 'Hide Controls', 'label for hide controls button without length constraints' ) ); ?>">
+			<button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php echo esc_attr_x( 'Hide Controls', 'label for hide controls button without length constraints' ); ?>">
 				<span class="collapse-sidebar-arrow"></span>
 				<span class="collapse-sidebar-label"><?php _ex( 'Hide Controls', 'short (~12 characters) label for hide controls button' ); ?></span>
 			</button>