Blocks: Add missing apiVersion field when preparing server-registered blocks for the block editor

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.

Fixes #52512.


Built from https://develop.svn.wordpress.org/trunk@50297


git-svn-id: http://core.svn.wordpress.org/trunk@49942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
gziolo 2021-02-12 16:00:06 +00:00
parent 463df820f8
commit 135a35fd04
2 changed files with 6 additions and 5 deletions

View File

@ -2240,18 +2240,19 @@ function get_block_editor_server_block_settings() {
$block_registry = WP_Block_Type_Registry::get_instance();
$blocks = array();
$fields_to_pick = array(
'api_version' => 'apiVersion',
'title' => 'title',
'description' => 'description',
'icon' => 'icon',
'category' => 'category',
'keywords' => 'keywords',
'parent' => 'parent',
'supports' => 'supports',
'attributes' => 'attributes',
'provides_context' => 'providesContext',
'uses_context' => 'usesContext',
'supports' => 'supports',
'category' => 'category',
'styles' => 'styles',
'textdomain' => 'textdomain',
'parent' => 'parent',
'keywords' => 'keywords',
'example' => 'example',
);

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-beta2-50295';
$wp_version = '5.7-beta2-50297';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.