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.

Props walbo, kevin940726, noisysocks.
Merges [51716] to the 5.8 branch.
Fixes #53609.
Built from https://develop.svn.wordpress.org/branches/5.8@51720


git-svn-id: http://core.svn.wordpress.org/branches/5.8@51326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-09-01 19:09:57 +00:00
parent 2a23de5be9
commit 9134e272c6
2 changed files with 5 additions and 1 deletions

View File

@ -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…' ) );
?>

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8.1-alpha-51718';
$wp_version = '5.8.1-alpha-51720';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.