Changeset 53084
- Timestamp:
- 04/06/2022 09:45:31 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r53056 r53084 2233 2233 'textdomain' => 'textdomain', 2234 2234 'parent' => 'parent', 2235 'ancestor' => 'ancestor', 2235 2236 'keywords' => 'keywords', 2236 2237 'example' => 'example', -
trunk/src/wp-includes/class-wp-block-type.php
r52652 r53084 60 60 61 61 /** 62 * Setting ancestor makes a block available only inside the specified 63 * block types at any position of the ancestor's block subtree. 64 * 65 * @since 6.0.0 66 * @var array|null 67 */ 68 public $ancestor = null; 69 70 /** 62 71 * Block type icon. 63 72 * … … 208 217 * @since 5.8.0 Added the `variations` property. 209 218 * @since 5.9.0 Added the `view_script` property. 219 * @since 6.0.0 Added the `ancestor` property. 210 220 * 211 221 * @see register_block_type() … … 222 232 * @type array|null $parent Setting parent lets a block require that it is only 223 233 * available when nested within the specified blocks. 234 * @type array|null $ancestor Setting ancestor makes a block available only inside the specified 235 * block types at any position of the ancestor's block subtree. 224 236 * @type string|null $icon Block type icon. 225 237 * @type string $description A detailed block type description. -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
r51786 r53084 267 267 'keywords', 268 268 'parent', 269 'ancestor', 269 270 'provides_context', 270 271 'uses_context', … … 646 647 'readonly' => true, 647 648 ), 649 'ancestor' => array( 650 'description' => __( 'Ancestor blocks.' ), 651 'type' => array( 'array', 'null' ), 652 'items' => array( 653 'type' => 'string', 654 ), 655 'default' => null, 656 'context' => array( 'embed', 'view', 'edit' ), 657 'readonly' => true, 658 ), 648 659 'keywords' => $keywords_definition, 649 660 'example' => $example_definition, -
trunk/tests/phpunit/tests/admin/includesPost.php
r52010 r53084 829 829 'category' => 'common', 830 830 'render_callback' => 'foo', 831 'ancestor' => array( 'core/test-ancestor' ), 831 832 ); 832 833 … … 847 848 'category' => 'common', 848 849 'styles' => array(), 850 'ancestor' => array( 'core/test-ancestor' ), 849 851 'keywords' => array(), 850 852 'variations' => array(), -
trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php
r51501 r53084 222 222 'example' => 'invalid_example', 223 223 'parent' => 'invalid_parent', 224 'ancestor' => 'invalid_ancestor', 224 225 'supports' => 'invalid_supports', 225 226 'styles' => 'invalid_styles', … … 247 248 $this->assertSameSets( array( 'invalid_keywords' ), $data['keywords'] ); 248 249 $this->assertSameSets( array( 'invalid_parent' ), $data['parent'] ); 250 $this->assertSameSets( array( 'invalid_ancestor' ), $data['ancestor'] ); 249 251 $this->assertSameSets( array(), $data['supports'] ); 250 252 $this->assertSameSets( array(), $data['styles'] ); … … 276 278 'keywords' => false, 277 279 'parent' => false, 280 'ancestor' => false, 278 281 'supports' => false, 279 282 'styles' => false, … … 302 305 $this->assertSameSets( array(), $data['keywords'] ); 303 306 $this->assertSameSets( array(), $data['parent'] ); 307 $this->assertSameSets( array(), $data['ancestor'] ); 304 308 $this->assertSameSets( array(), $data['supports'] ); 305 309 $this->assertSameSets( array(), $data['styles'] ); … … 379 383 $data = $response->get_data(); 380 384 $properties = $data['schema']['properties']; 381 $this->assertCount( 2 2, $properties );385 $this->assertCount( 23, $properties ); 382 386 $this->assertArrayHasKey( 'api_version', $properties ); 383 387 $this->assertArrayHasKey( 'title', $properties ); … … 402 406 $this->assertArrayHasKey( 'provides_context', $properties ); 403 407 $this->assertArrayHasKey( 'variations', $properties ); 408 $this->assertArrayHasKey( 'ancestor', $properties ); 404 409 } 405 410
Note: See TracChangeset
for help on using the changeset viewer.