[wp-trac] [WordPress Trac] #59466: Twenty Twenty-Four custom button block style path incorrectly registered
WordPress Trac
noreply at wordpress.org
Tue Sep 26 21:06:21 UTC 2023
#59466: Twenty Twenty-Four custom button block style path incorrectly registered
---------------------------+-------------------------
Reporter: flixos90 | Owner: flixos90
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.4
Component: Bundled Theme | Version:
Severity: normal | Keywords: needs-patch
Focuses: performance |
---------------------------+-------------------------
As noted in #59465, a render-blocking `button-outline.css` file from TT4
is enqueued, even though that CSS file is so small it should be inlined.
Looking at the TT4 code, it ''does'' intend to pass the stylesheet's path
to WordPress core, so that core can inline the file contents, however the
way that happens contains a bug.
Given the block style relies on `wp_enqueue_block_style()` (not
`wp_enqueue_style()`), `wp_style_add_data()` cannot be used with it, since
the actual stylesheet won't be registered yet. In other words, the
`wp_style_add_data()` call there doesn't do anything.
This is a bit confusing, particularly since `wp_enqueue_block_style()`
lacks documentation that the `$path` can actually be provided there as an
argument, which only becomes clear when looking at the code of that
function. This should be updated here as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59466>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list