Changeset 49224
- Timestamp:
- 10/20/2020 07:52:06 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r49120 r49224 208 208 'styles' => 'styles', 209 209 'example' => 'example', 210 'apiVersion' => 'api_version', 210 211 ); 211 212 -
trunk/src/wp-includes/class-wp-block-type.php
r49120 r49224 16 16 */ 17 17 class WP_Block_Type { 18 19 /** 20 * Block API version. 21 * 22 * @since 5.6.0 23 * @var int 24 */ 25 public $api_version = 1; 18 26 19 27 /** -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
r48982 r49224 257 257 $schema = $this->get_item_schema(); 258 258 $extra_fields = array( 259 'api_version', 259 260 'name', 260 261 'title', … … 366 367 'type' => 'object', 367 368 '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 ), 368 376 'title' => array( 369 377 'description' => __( 'Title of block type.' ), -
trunk/tests/phpunit/tests/blocks/fixtures/block.json
r48845 r49224 1 1 { 2 "apiVersion": 2, 2 3 "name": "my-plugin/notice", 3 4 "title": "Notice", -
trunk/tests/phpunit/tests/blocks/register.php
r48939 r49224 286 286 287 287 $this->assertInstanceOf( 'WP_Block_Type', $result ); 288 $this->assertSame( 2, $result->api_version ); 288 289 $this->assertSame( 'my-plugin/notice', $result->name ); 289 290 $this->assertSame( 'Notice', $result->title ); -
trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php
r48939 r49224 313 313 $data = $response->get_data(); 314 314 $properties = $data['schema']['properties']; 315 $this->assertCount( 19, $properties ); 315 $this->assertCount( 20, $properties ); 316 $this->assertArrayHasKey( 'api_version', $properties ); 316 317 $this->assertArrayHasKey( 'title', $properties ); 317 318 $this->assertArrayHasKey( 'icon', $properties ); … … 432 433 433 434 $extra_fields = array( 435 'api_version', 434 436 'name', 435 437 'category',
Note: See TracChangeset
for help on using the changeset viewer.