[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
Tue Oct 28 05:32:30 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: closed
Priority: normal | Milestone: 6.9
Component: Script Loader | Version: trunk
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+--------------------------
Changes (by westonruter):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"61076" 61076]:
{{{
#!CommitTicketReference repository="" revision="61076"
Script Loader: Fall back to hoisting late-printed styles to end of `HEAD`
if `wp-block-library` is not enqueued.
When the `wp-block-library` stylesheet is not enqueued, there will be no
associated inline style present. This inline style normally contains the
placeholder CSS comment for the HTML Tag Processor to identify the token
after which the late-printed styles should be inserted. However, when the
`wp-block-library` stylesheet is not enqueued (such as in themes which do
not use blocks), or else the inline style is not printed for whatever
reason, this adds a fallback to insert the late-printed styles immediately
before `</head>`. This ensures that late-printed styles will always get
hoisted.
Developed in https://github.com/WordPress/wordpress-develop/pull/10417
Follow-up to [61008].
Props westonruter, peterwilsoncc, Soean.
See #64099, #43258.
Fixes #64150.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64150#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list