Make WordPress Core


Ignore:
Timestamp:
10/20/2020 07:52:06 AM (4 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/blocks/register.php

    r48939 r49224  
    286286
    287287        $this->assertInstanceOf( 'WP_Block_Type', $result );
     288        $this->assertSame( 2, $result->api_version );
    288289        $this->assertSame( 'my-plugin/notice', $result->name );
    289290        $this->assertSame( 'Notice', $result->title );
Note: See TracChangeset for help on using the changeset viewer.