Make WordPress Core


Ignore:
Timestamp:
10/20/2020 07:52:06 AM (6 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/tests/phpunit/tests/rest-api/rest-block-type-controller.php

    r48939 r49224  
    313313                $data       = $response->get_data();
    314314                $properties = $data['schema']['properties'];
    315                 $this->assertCount( 19, $properties );
     315                $this->assertCount( 20, $properties );
     316                $this->assertArrayHasKey( 'api_version', $properties );
    316317                $this->assertArrayHasKey( 'title', $properties );
    317318                $this->assertArrayHasKey( 'icon', $properties );
     
    432433
    433434                $extra_fields = array(
     435                        'api_version',
    434436                        'name',
    435437                        'category',
Note: See TracChangeset for help on using the changeset viewer.