[wp-trac] [WordPress Trac] #52512: Blocks: Add missing apiVersion field when preparing server-registered blocks for the block editor

WordPress Trac noreply at wordpress.org
Fri Feb 12 15:56:34 UTC 2021


#52512: Blocks: Add missing apiVersion field when preparing server-registered
blocks for the block editor
--------------------------+---------------------
 Reporter:  gziolo        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.7
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------
Description changed by gziolo:

Old description:

> When working on changes to `@wordpress/create-block` tool to use
> `register_block_type_from_metadata` with `block.json` file in the
> templates for scaffolded blocks I run into this issue where `apiVersion`
> wasn't exposed from the server. This patch tries to address it.
>
> I also double-checked that all necessary fields exposed in the REST API
> endpoint with block types are included
> `get_block_editor_server_block_settings` call that is eventually going to
> be deprecated in favor of the former. See the list for reference:
> https://developer.wordpress.org/rest-api/reference/block-types/
>
> In the patch attached I also reordered the list of fields to match the
> REST API documentation.

New description:

 When working on changes to `@wordpress/create-block` tool
 (https://github.com/WordPress/gutenberg/pull/28883) to use
 `register_block_type_from_metadata` with `block.json` file in the
 templates for scaffolded blocks I run into this issue where `apiVersion`
 wasn't exposed from the server. This patch tries to address it.

 I also double-checked that all necessary fields exposed in the REST API
 endpoint with block types are included
 `get_block_editor_server_block_settings` call that is eventually going to
 be deprecated in favor of the former. See the list for reference:
 https://developer.wordpress.org/rest-api/reference/block-types/

 In the patch attached I also reordered the list of fields to match the
 REST API documentation.

--

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


More information about the wp-trac mailing list