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
+1 -1
View File
@@ -2234,7 +2234,7 @@ function get_block_categories( $post ) {
function get_block_editor_server_block_settings() {
$block_registry = WP_Block_Type_Registry::get_instance();
$blocks = array();
$keys_to_pick = array( 'title', 'description', 'icon', 'category', 'keywords', 'parent', 'supports', 'attributes', 'styles' );
$keys_to_pick = array( 'title', 'description', 'icon', 'category', 'keywords', 'parent', 'supports', 'attributes', 'styles', 'textdomain', 'example' );
foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {
foreach ( $keys_to_pick as $key ) {