Make WordPress Core


Ignore:
Timestamp:
07/06/2021 03:16:32 PM (3 years ago)
Author:
desrosj
Message:

Editor: Ensure global styles are loaded in the footer when loading core assets individually.

This fixes the logic in wp_enqueue_global_styles() to ensure that global styles are loaded in the footer when a site opts-in to loading Core block assets individually.

This fixes a bug where styles defined in themes.json are not respected.

Props walbo, nosolosw, mcsf, aristath, desrosj, jorbin.
Merges [51309] to the 5.8 branch.
Fixes #53494.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/default-filters.php

    r51315 r51347  
    555555add_action( 'wp_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );
    556556add_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
    557 add_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
    558557add_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );
    559558add_action( 'admin_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
     
    569568add_filter( 'customize_controls_print_styles', 'wp_resource_hints', 1 );
    570569
     570// Global styles can be enqueued in both the header and the footer. See https://core.trac.wordpress.org/ticket/53494.
     571add_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
     572add_action( 'wp_footer', 'wp_enqueue_global_styles', 1 );
     573
    571574add_action( 'wp_default_styles', 'wp_default_styles' );
    572575add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.