[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
Fri Feb 18 08:09:57 UTC 2022


#54647: Blocks: Add support for themes to block API v2 with assets in block.json
-------------------------------------------+------------------------------
 Reporter:  whoisnegrello                  |       Owner:  (none)
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Editor                         |     Version:  5.5
 Severity:  normal                         |  Resolution:
 Keywords:  has-patch needs-testing close  |     Focuses:
-------------------------------------------+------------------------------
Changes (by ocean90):

 * keywords:  has-patch needs-testing => has-patch needs-testing close
 * milestone:  6.0 => Awaiting Review


Comment:

 I'd say that this was and is by design. Blocks are not supposed to be
 registered in themes. Instead you should have dedicated plugins which
 register blocks. The WordPress.org theme directory also
 [https://make.wordpress.org/themes/handbook/review/required/#5
 -functionality-and-features doesn't allow blocks to be included] and tools
 like [https://developer.wordpress.org/block-editor/reference-
 guides/packages/packages-create-block/ @wordpress/create-block] make it
 quite easy to create plugins for blocks.

 [attachment:"fix.diff"] has a few issues: It hardcodes the directory names
 for plugins and themes and there are more functions which only expect
 blocks to be in plugins, for example `_wp_multiple_block_styles()`.

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


More information about the wp-trac mailing list