Make WordPress Core


Ignore:
Timestamp:
10/20/2020 07:52:06 AM (3 years ago)
Author:
youknowriad
Message:

Block Editor: Expose api_version in the block type and the REST endpoint.

The new block editor included in 5.6 introduces an api_version property
that indicates which block API version the block is using.
This commits makes this property available on the block type and the endpoint.

Props TimothyBlynJacobs, gziolo.
Fixes #51529.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php

    r48982 r49224  
    257257        $schema       = $this->get_item_schema();
    258258        $extra_fields = array(
     259            'api_version',
    259260            'name',
    260261            'title',
     
    366367            'type'       => 'object',
    367368            'properties' => array(
     369                'api_version'            => array(
     370                    'description' => __( 'Version of block API.' ),
     371                    'type'        => 'integer',
     372                    'default'     => 1,
     373                    'context'     => array( 'embed', 'view', 'edit' ),
     374                    'readonly'    => true,
     375                ),
    368376                'title'            => array(
    369377                    'description' => __( 'Title of block type.' ),
Note: See TracChangeset for help on using the changeset viewer.