Make WordPress Core

Changeset 51540


Ignore:
Timestamp:
08/04/2021 05:09:08 AM (3 years ago)
Author:
peterwilsoncc
Message:

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.
Fixes #53696.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r51533 r51540  
    27332733 */
    27342734function wp_add_iframed_editor_assets_html() {
     2735    if ( ! wp_should_load_block_editor_scripts_and_styles() ) {
     2736        return;
     2737    }
     2738
    27352739    $script_handles = array();
    27362740    $style_handles  = array(
Note: See TracChangeset for help on using the changeset viewer.