From afb38a6eb6a02f949b12ae381438d0b7c7bbef0e Mon Sep 17 00:00:00 2001
From: Robert Anderson <noisysocks@git.wordpress.org>
Date: Wed, 1 Sep 2021 07:09:05 +0000
Subject: [PATCH] Customize: Add wp-embed-responsive class to body if using
 widgets block editor

Appends the wp-embed-responsive class to the body if the widgets block editor is
enabled. This fixes a bug preventing embeds (e.g. YouTube embeds) appearing in
the widgets block editor.

Fixes #53609.
Props walbo, kevin940726.


git-svn-id: https://develop.svn.wordpress.org/trunk@51716 602fd350-edb4-49c9-b593-d223f7449a82
---
 src/wp-admin/customize.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/wp-admin/customize.php b/src/wp-admin/customize.php
index 0c9298784c..0dd548d43a 100644
--- a/src/wp-admin/customize.php
+++ b/src/wp-admin/customize.php
@@ -144,6 +144,10 @@ if ( is_rtl() ) {
 }
 $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&hellip;' ) );
 
 ?>