WordPress.org

Make WordPress Core

Ticket #45302: 45302.patch

File 45302.patch, 749 bytes (added by ocean90, 3 years ago)
  • src/wp-includes/script-loader.php

     
    22842284 * @global WP_Screen $current_screen
    22852285 */
    22862286function wp_enqueue_registered_block_scripts_and_styles() {
    2287         global $current_screen;
     2287        $current_screen = get_current_screen();
     2288        $is_editor      = $current_screen instanceof WP_Screen && $current_screen->is_block_editor();
    22882289
    2289         $is_editor = ( is_admin() && $current_screen->is_block_editor() );
    2290 
    22912290        $block_registry = WP_Block_Type_Registry::get_instance();
    22922291        foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {
    22932292                // Front-end styles.