mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-26 23:59:40 +02:00
Syncing stable blocks from the Gutenberg repository to wordpress-develop was a manual process, but it got automated with the script that runs together with syncing WordPress packages changed in the Gutenberg package. Props zieladam. Fixes #56179. Built from https://develop.svn.wordpress.org/trunk@53688 git-svn-id: http://core.svn.wordpress.org/trunk@53247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
30 lines
779 B
PHP
30 lines
779 B
PHP
<?php
|
|
/**
|
|
* Used to set up all core blocks used with the block editor.
|
|
*
|
|
* @package WordPress
|
|
*/
|
|
|
|
define( 'BLOCKS_PATH', ABSPATH . WPINC . '/blocks/' );
|
|
|
|
// Include files required for core blocks registration.
|
|
require BLOCKS_PATH . 'legacy-widget.php';
|
|
require BLOCKS_PATH . 'widget-group.php';
|
|
require BLOCKS_PATH . 'require-dynamic-blocks.php';
|
|
|
|
/**
|
|
* Registers core block types using metadata files.
|
|
* Dynamic core blocks are registered separately.
|
|
*
|
|
* @since 5.5.0
|
|
*/
|
|
function register_core_block_types_from_metadata() {
|
|
$block_folders = require BLOCKS_PATH . 'require-static-blocks.php';
|
|
foreach ( $block_folders as $block_folder ) {
|
|
register_block_type(
|
|
BLOCKS_PATH . $block_folder
|
|
);
|
|
}
|
|
}
|
|
add_action( 'init', 'register_core_block_types_from_metadata' );
|