Make WordPress Core


Ignore:
Timestamp:
05/11/2021 02:14:15 PM (4 years ago)
Author:
gziolo
Message:

Editor: Fix regression introduced with loading separate block assets

Related to [50836]. load-styles.php doesn't load the should_load_separate_core_block_assets function and that causes an error 500 - which in turn makes the dashboard appear unstyled.

Props aristath.
Fixes #53180.

File:
1 edited

Legend:

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

    r50836 r50837  
    953953    return true === $block_support || is_array( $block_support );
    954954}
    955 
    956 /**
    957  * Checks whether separate assets should be loaded for core blocks.
    958  *
    959  * @since 5.8
    960  *
    961  * @return bool
    962  */
    963 function should_load_separate_core_block_assets() {
    964     if ( is_admin() || is_feed() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
    965         return false;
    966     }
    967     /**
    968      * Determine if separate styles & scripts will be loaded for blocks on-render or not.
    969      *
    970      * @since 5.8.0
    971      *
    972      * @param bool $load_separate_styles Whether separate styles will be loaded or not.
    973      *
    974      * @return bool Whether separate styles will be loaded or not.
    975      */
    976     return apply_filters( 'separate_core_block_assets', false );
    977 }
Note: See TracChangeset for help on using the changeset viewer.