[wp-trac] [WordPress Trac] #64150: Late-printed styles are not hoisted to HEAD if wp-block-library is not enqueued
WordPress Trac
noreply at wordpress.org
Mon Oct 27 19:25:21 UTC 2025
#64150: Late-printed styles are not hoisted to HEAD if wp-block-library is not
enqueued
--------------------------------------+--------------------------
Reporter: westonruter | Owner: westonruter
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.9
Component: Script Loader | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+--------------------------
Comment (by westonruter):
Excellent.
For reference, here is the plugin code I used to test this with a classic
theme (e.g. Twenty Ten):
{{{#!php
<?php
/**
* Plugin Name: Disable Block Styles
*/
add_action(
'enqueue_block_assets',
function (): void {
wp_deregister_style( 'wp-block-library' );
wp_register_style( 'wp-block-library', '' );
}
);
add_action(
'after_setup_theme',
static function (): void {
remove_theme_support( 'wp-block-styles' );
},
PHP_INT_MAX
);
}}}
Without that [https://github.com/WordPress/wordpress-
develop/pull/10417/commits/e4bd8c70000b2ad65e72706e937e3db5131804f1
commit], I see a lot of block-specific styles being enqueued. With the
commit, they are excluded.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64150#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list