[wp-trac] [WordPress Trac] #63676: Blocks without rendered content still enqueue scripts and styles
WordPress Trac
noreply at wordpress.org
Wed Jul 9 00:41:59 UTC 2025
#63676: Blocks without rendered content still enqueue scripts and styles
-------------------------------------+-------------------------------------
Reporter: westonruter | Owner: westonruter
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 6.9
Component: Editor | Version: 5.9
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses: javascript, css,
needs-unit-tests dev-feedback | performance
-------------------------------------+-------------------------------------
Changes (by westonruter):
* keywords: has-patch needs-testing needs-unit-tests => has-patch needs-
testing needs-unit-tests dev-feedback
Comment:
Replying to [comment:2 dd32]:
> I can imagine someone could have a block that renders nothing, but
enqueues scripts that affect the page in some manner.
>
> It would normally make sense that a block with scripts like that would
render a placeholder tag for where the script would affect, but I guess it
would be possible for a script to affect the entire page instead of
needing that placeholder tag.
I'd love to see an example of this in the wild. Otherwise, the current
behavior seems more counter-intuitive: if I add a plugin that filters out
all blocks of a given type, I wouldn't expect its CSS and JS to still be
added to the page.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63676#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list