From e3a98e8f559029a32264b83eae59f90e6e7a375d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=83=C2=B3=C3=85=E2=80=9Akowski?= Date: Fri, 12 Feb 2021 15:58:53 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@50297 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 20a3fb1354..1a0fef056e 100644 --- a/src/wp-admin/includes/post.php +++ b/src/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', );