[wp-trac] [WordPress Trac] #54647: Blocks: Add support for themes to block API v2 with assets in block.json

WordPress Trac noreply at wordpress.org
Wed May 11 12:29:07 UTC 2022


#54647: Blocks: Add support for themes to block API v2 with assets in block.json
-------------------------------------------------+-------------------------
 Reporter:  whoisnegrello                        |       Owner:  gziolo
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.0
Component:  Editor                               |     Version:  5.5
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:
  tests needs-dev-note                           |
-------------------------------------------------+-------------------------

Comment (by fabiankaegy):

 @matveb Apologies I just now also saw your comment here on this ticket.

 Yes, it always has been possible to register blocks via the manual
 `register_block_type` mechanism. The reason for adding support for blocks
 using `block.json` from within themes from my perspective is, that
 especially when you are working with dynamic blocks, the overhead of
 having to keep your attribute declaration and overall block registration
 in sync between the PHP and JS version is a pain. This is also why the
 `block.json` mechanism got introduced in the first place. And since there
 already were hacky solutions like being able to filter the `plugins_url`
 out there in the world that made it work to use the more modern simplified
 approach, I don't see the reason for keeping this functionality from
 anybody that has a reasonable rationale for including a block in a custom
 build theme.

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


More information about the wp-trac mailing list