Files
wordpress/wp-includes/script-loader.php
Weston Ruter 4a1a88562b Script Loader: Move wp_load_classic_theme_block_styles_on_demand() from init to wp_default_styles.
This ensures the filters to opt in to loading separate block styles on demand are added at the moment `WP_Styles` is constructed. This accounts for styles being registered at the `init` action before `register_core_block_style_handles()` runs at priority 9. Without this, the `wp-block-library` stylesheet may get registered with the full combined block styles as `style.css` instead of just `common.css`, due to `wp_should_load_block_assets_on_demand()` still returning false. The `wp_default_styles` action still runs during `init`.

Developed in https://github.com/WordPress/wordpress-develop/pull/11232

Follow-up to r61008.

Props westonruter, adamsilverstein.
See #64099.
Fixes #64846.

Built from https://develop.svn.wordpress.org/trunk@61981


git-svn-id: http://core.svn.wordpress.org/trunk@61263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-03-12 05:45:46 +00:00

159 KiB