Make WordPress Core

Changeset 51716 for trunk


Ignore:
Timestamp:
09/01/2021 07:09:05 AM (3 years ago)
Author:
noisysocks
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r51251 r51716  
    144144}
    145145$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
     146
     147if ( wp_use_widgets_block_editor() ) {
     148    $body_class .= ' wp-embed-responsive';
     149}
    146150
    147151$admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loading…' ) );
Note: See TracChangeset for help on using the changeset viewer.