diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 9df70abaf4..a2fd54cf31 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -286,6 +286,7 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) { 'title' => 'title', 'category' => 'category', 'parent' => 'parent', + 'ancestor' => 'ancestor', 'icon' => 'icon', 'description' => 'description', 'keywords' => 'keywords', diff --git a/tests/phpunit/data/blocks/notice/block.json b/tests/phpunit/data/blocks/notice/block.json index d448a49c5c..56ffe73407 100644 --- a/tests/phpunit/data/blocks/notice/block.json +++ b/tests/phpunit/data/blocks/notice/block.json @@ -4,7 +4,10 @@ "title": "Notice", "category": "common", "parent": [ - "core/group" + "tests/group" + ], + "ancestor": [ + "tests/section" ], "providesContext": { "tests/message": "message" diff --git a/tests/phpunit/tests/blocks/register.php b/tests/phpunit/tests/blocks/register.php index 408927197a..6dcc0f8d04 100644 --- a/tests/phpunit/tests/blocks/register.php +++ b/tests/phpunit/tests/blocks/register.php @@ -381,7 +381,8 @@ class Tests_Blocks_Register extends WP_UnitTestCase { $this->assertSame( 'tests/notice', $result->name ); $this->assertSame( 'Notice', $result->title ); $this->assertSame( 'common', $result->category ); - $this->assertSameSets( array( 'core/group' ), $result->parent ); + $this->assertSameSets( array( 'tests/group' ), $result->parent ); + $this->assertSameSets( array( 'tests/section' ), $result->ancestor ); $this->assertSame( 'star', $result->icon ); $this->assertSame( 'Shows warning, error or success notices…', $result->description ); $this->assertSameSets( array( 'alert', 'message' ), $result->keywords );