WordPress.org

Make WordPress Core

Changeset 50297


Ignore:
Timestamp:
02/12/2021 03:58:53 PM (9 months ago)
Author:
gziolo
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r50282 r50297  
    22412241    $blocks         = array();
    22422242    $fields_to_pick = array(
     2243        'api_version'      => 'apiVersion',
    22432244        'title'            => 'title',
    22442245        'description'      => 'description',
    22452246        'icon'             => 'icon',
    2246         'category'         => 'category',
    2247         'keywords'         => 'keywords',
    2248         'parent'           => 'parent',
    2249         'supports'         => 'supports',
    22502247        'attributes'       => 'attributes',
    22512248        'provides_context' => 'providesContext',
    22522249        'uses_context'     => 'usesContext',
     2250        'supports'         => 'supports',
     2251        'category'         => 'category',
    22532252        'styles'           => 'styles',
    22542253        'textdomain'       => 'textdomain',
     2254        'parent'           => 'parent',
     2255        'keywords'         => 'keywords',
    22552256        'example'          => 'example',
    22562257    );
Note: See TracChangeset for help on using the changeset viewer.