From a6bf8d7afbaadd1d7a37e29f878bd8441349c0f3 Mon Sep 17 00:00:00 2001 From: gziolo Date: Fri, 12 Feb 2021 16:00:06 +0000 Subject: [PATCH] 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 --- wp-admin/includes/post.php | 9 +++++---- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 20a3fb1354c0..1a0fef056e6d 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -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', ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 134a6d42e301..c2408932981f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.