[wp-trac] [WordPress Trac] #56408: Blocks: Allow registering multiple items for all supported asset types

WordPress Trac noreply at wordpress.org
Fri Aug 19 10:01:30 UTC 2022


#56408: Blocks: Allow registering multiple items for all supported asset types
-------------------------+-------------------------------------------------
 Reporter:  gziolo       |      Owner:  (none)
     Type:  task         |     Status:  assigned
  (blessed)              |
 Priority:  normal       |  Milestone:  6.1
Component:  Editor       |    Version:
 Severity:  normal       |   Keywords:  has-patch dev-feedback has-unit-
  Focuses:               |  tests
-------------------------+-------------------------------------------------
 Part of https://github.com/WordPress/gutenberg/issues/41236. More details
 in https://github.com/WordPress/gutenberg/issues/33542.

 This PR is heavily inspired by the work done by @zieladam in #56094.

 The idea is to allow more than one script per block for `editorScript`,
 `script`, and `viewScript`. @aristath already added that capability for
 `style` and `editorStyle` a long time ago with
 https://github.com/WordPress/gutenberg/pull/32510. It was backported to
 WordPress core using the same hooks that Gutenberg uses with [52069] as
 part of #54337, which causes issues like the one reported in
 https://github.com/WordPress/gutenberg/issues/43086. Here, the code gets
 refactored for `style`, `editorStyle` so multiple assets are supported
 natively in `WP_Block_Type` class and in the REST API endpoint for block
 types. The same implementation is mirrored for scripts: `editorScript`,
 `script` and `viewScript`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56408>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list