[wp-trac] [WordPress Trac] #54790: Stylesheets enqueued via `wp_enqueue_block_style` should only be enqueued when the block gets rendered

WordPress Trac noreply at wordpress.org
Tue Jan 11 16:02:44 UTC 2022


#54790: Stylesheets enqueued via `wp_enqueue_block_style` should only be enqueued
when the block gets rendered
------------------------------+-----------------------------
 Reporter:  aristath          |       Owner:  hellofromTonya
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  5.9
Component:  Editor            |     Version:  trunk
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
------------------------------+-----------------------------
Changes (by hellofromTonya):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 Whoopsie [52556] had the wrong ticket number :facepalm:. Manually adding
 it here.

 In [changeset:"52556" 52556]:

 Editor: Fix enqueueing additional styles in `wp_enqueue_block_style()` to
 print only when blocks render.

 In a block theme, additional block styles registered using the
 `wp_enqueue_block_style` function should only get printed when the block
 exists on a page. However, they currently always get rendered.

 This commit is a backport from Gutenberg that fixes the issue by printing
 the styles when a block renders.

 Follow-up to [52069].

 Props poena, aristath, Mamaduka.
 Fixes #54787.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54790#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list