Make WordPress Core

Changeset 51593


Ignore:
Timestamp:
08/10/2021 04:33:46 PM (5 years ago)
Author:
desrosj
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, peterwilsoncc.
Merges [51540] to the 5.8 branch.
Fixes #53696.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/script-loader.php

    r51546 r51593  
    27072707 */
    27082708function wp_add_iframed_editor_assets_html() {
     2709        if ( ! wp_should_load_block_editor_scripts_and_styles() ) {
     2710                return;
     2711        }
     2712
    27092713        $script_handles = array();
    27102714        $style_handles  = array(
Note: See TracChangeset for help on using the changeset viewer.