Editor: Prevent block-editor JavaScript loading in other editors.

Add a check to `wp_add_iframed_editor_assets_html()` confirming the edit post screen is using the block-editor before including block-editor specific JavaScript. For the classic and other editors the function returns early without any output.

Props swissspidy, desrosj, peterwilsoncc.
Merges [51540] to the 5.8 branch.
Fixes #53696.
Built from https://develop.svn.wordpress.org/branches/5.8@51593


git-svn-id: http://core.svn.wordpress.org/branches/5.8@51204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-08-10 16:35:04 +00:00
parent 2b90cc4361
commit 3616f5bf0b
2 changed files with 5 additions and 1 deletions

View File

@ -2706,6 +2706,10 @@ function wp_maybe_inline_styles() {
* @since 5.8.0
*/
function wp_add_iframed_editor_assets_html() {
if ( ! wp_should_load_block_editor_scripts_and_styles() ) {
return;
}
$script_handles = array();
$style_handles = array(
'wp-block-editor',

View File

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