Skip to content

Commit

Permalink
Blocks: Add missing apiVersion field when preparing server-registered…
Browse files Browse the repository at this point in the history
… blocks for the block editor

When working on changes to @wordpress/create-block tool (WordPress/gutenberg#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
  • Loading branch information
gziolo committed Feb 12, 2021
1 parent 463df82 commit 135a35f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions wp-admin/includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 135a35f

Please sign in to comment.