mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Editor: Move core blocks registration to init hook
After working on support for register_block_type_args filter in #49615, it became clear that we need to use init action for core blocks to make it possible to use this filter. Fixes #50263. Built from https://develop.svn.wordpress.org/trunk@48279 git-svn-id: http://core.svn.wordpress.org/trunk@48048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f7d2a408d9
commit
707cb4a35b
@ -18,41 +18,50 @@ require ABSPATH . WPINC . '/blocks/shortcode.php';
|
|||||||
require ABSPATH . WPINC . '/blocks/social-link.php';
|
require ABSPATH . WPINC . '/blocks/social-link.php';
|
||||||
require ABSPATH . WPINC . '/blocks/tag-cloud.php';
|
require ABSPATH . WPINC . '/blocks/tag-cloud.php';
|
||||||
|
|
||||||
$block_folders = array(
|
/**
|
||||||
'audio',
|
* Registers core block types using metadata files.
|
||||||
'button',
|
* Dynamic core blocks are registered separately.
|
||||||
'buttons',
|
*
|
||||||
'classic',
|
* @since 5.5.0
|
||||||
'code',
|
*/
|
||||||
'column',
|
function register_core_block_types_from_metadata() {
|
||||||
'columns',
|
$block_folders = array(
|
||||||
'file',
|
'audio',
|
||||||
'gallery',
|
'button',
|
||||||
'group',
|
'buttons',
|
||||||
'heading',
|
'classic',
|
||||||
'html',
|
'code',
|
||||||
'image',
|
'column',
|
||||||
'list',
|
'columns',
|
||||||
'media-text',
|
'file',
|
||||||
'missing',
|
'gallery',
|
||||||
'more',
|
'group',
|
||||||
'nextpage',
|
'heading',
|
||||||
'paragraph',
|
'html',
|
||||||
'preformatted',
|
'image',
|
||||||
'pullquote',
|
'list',
|
||||||
'quote',
|
'media-text',
|
||||||
'separator',
|
'missing',
|
||||||
'social-links',
|
'more',
|
||||||
'spacer',
|
'nextpage',
|
||||||
'subhead',
|
'paragraph',
|
||||||
'table',
|
'preformatted',
|
||||||
'text-columns',
|
'pullquote',
|
||||||
'verse',
|
'quote',
|
||||||
'video',
|
'separator',
|
||||||
);
|
'social-links',
|
||||||
|
'spacer',
|
||||||
foreach ( $block_folders as $block_folder ) {
|
'subhead',
|
||||||
register_block_type_from_metadata(
|
'table',
|
||||||
ABSPATH . WPINC . '/blocks/' . $block_folder
|
'text-columns',
|
||||||
|
'verse',
|
||||||
|
'video',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
foreach ( $block_folders as $block_folder ) {
|
||||||
|
register_block_type_from_metadata(
|
||||||
|
ABSPATH . WPINC . '/blocks/' . $block_folder
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
add_action( 'init', 'register_core_block_types_from_metadata' );
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.5-alpha-48278';
|
$wp_version = '5.5-alpha-48279';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user