Add wp-embed-responsive body class to customizer#1476
Add wp-embed-responsive body class to customizer#1476walbo wants to merge 1 commit intoWordPress:masterfrom walbo:53609
Conversation
| _wp_admin_html_begin(); | ||
|
|
||
| $body_class = 'wp-core-ui wp-customizer js'; | ||
| $body_class = 'wp-core-ui wp-customizer wp-embed-responsive js'; |
There was a problem hiding this comment.
I'm not sure if we should add this regardlessly. It seems like we only add this if the theme supports responsive embeds in the post editor:
wordpress-develop/src/wp-includes/post-template.php
Lines 784 to 786 in b1f0971
We can add this if statement here as well. WDYT?
No wait, seems like it's being added here instead.
wordpress-develop/src/wp-admin/admin-header.php
Lines 192 to 194 in b1f0971
Since that every block editor will have this class in <body>, the fix seems reasonable.
However, I don't think the editor should be relying on class names on <body> to work. Probably worth to fix it in gutenberg instead.
There was a problem hiding this comment.
current_theme_supports( 'responsive-embeds' ) only applies frontend in the body_class().
Seems the class is added backend if the current screen is an block editor.
wordpress-develop/src/wp-admin/admin-header.php
Lines 192 to 194 in b1f0971
--
Did a quick test adding the conditional and removed responsive-embeds support. In the post editor the embeds work but in the cusomtizer they didn't.
There was a problem hiding this comment.
How about we add the class conditionally based on whether or not the block editor is being used in the Customizer?
if ( wp_use_widgets_block_editor() ) {
$body_class .= ' wp-embed-responsive';
}
Trac ticket: https://core.trac.wordpress.org/ticket/53609
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.