Add fields to WP_Block_Type

As part of #47620 and the RFC for block registeration. Server registered blocks are missing some fields. These changeset includes them.

Props spacedmonkey, aduth.

Fixes #48529.



git-svn-id: https://develop.svn.wordpress.org/trunk@47875 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Greg Ziółkowski
2020-06-01 12:25:34 +00:00
parent e0ede89881
commit 822ca9ebc7
4 changed files with 109 additions and 13 deletions
+10 -1
View File
@@ -825,6 +825,7 @@ class Tests_Admin_Includes_Post extends WP_UnitTestCase {
function test_get_block_editor_server_block_settings() {
$name = 'core/test';
$settings = array(
'category' => 'common',
'icon' => 'text',
'render_callback' => 'foo',
);
@@ -836,7 +837,15 @@ class Tests_Admin_Includes_Post extends WP_UnitTestCase {
unregister_block_type( $name );
$this->assertArrayHasKey( $name, $blocks );
$this->assertSame( array( 'icon' => 'text' ), $blocks[ $name ] );
$this->assertEquals( array(
'title' => '',
'description' => '',
'category' => 'common',
'icon' => 'text',
'keywords' => array(),
'supports' => array(),
'styles' => array(),
), $blocks[ $name ] );
}
/**