2020-07-01 14:29:03 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Used to set up all core blocks used with the block editor.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Include files required for core blocks registration.
|
|
|
|
require ABSPATH . WPINC . '/blocks/archives.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/block.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/calendar.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/categories.php';
|
2021-05-07 13:48:27 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/file.php';
|
2020-07-01 14:29:03 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/latest-comments.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/latest-posts.php';
|
2021-05-25 10:40:25 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/legacy-widget.php';
|
2021-05-19 17:09:27 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/loginout.php';
|
2021-06-08 20:13:01 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/page-list.php';
|
2021-05-19 17:09:27 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/post-content.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/post-date.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/post-excerpt.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/post-featured-image.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/post-terms.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/post-title.php';
|
2021-06-08 19:33:22 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/post-template.php';
|
2021-05-19 17:09:27 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/query.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/query-pagination.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/query-pagination-next.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/query-pagination-numbers.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/query-pagination-previous.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/query-title.php';
|
2020-07-01 14:29:03 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/rss.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/search.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/shortcode.php';
|
2021-05-19 17:09:27 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/site-tagline.php';
|
2021-06-08 10:27:58 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/site-logo.php';
|
2021-05-19 17:09:27 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/site-title.php';
|
2020-07-01 14:29:03 +02:00
|
|
|
require ABSPATH . WPINC . '/blocks/social-link.php';
|
|
|
|
require ABSPATH . WPINC . '/blocks/tag-cloud.php';
|
|
|
|
|
2020-07-02 19:22:03 +02:00
|
|
|
/**
|
|
|
|
* 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 = array(
|
|
|
|
'audio',
|
|
|
|
'button',
|
|
|
|
'buttons',
|
|
|
|
'code',
|
|
|
|
'column',
|
|
|
|
'columns',
|
2021-06-17 13:57:56 +02:00
|
|
|
'cover',
|
2020-10-19 22:57:07 +02:00
|
|
|
'embed',
|
2021-01-28 03:04:13 +01:00
|
|
|
'freeform',
|
2020-07-02 19:22:03 +02:00
|
|
|
'gallery',
|
|
|
|
'group',
|
|
|
|
'heading',
|
|
|
|
'html',
|
|
|
|
'image',
|
|
|
|
'list',
|
|
|
|
'media-text',
|
|
|
|
'missing',
|
|
|
|
'more',
|
|
|
|
'nextpage',
|
|
|
|
'paragraph',
|
|
|
|
'preformatted',
|
|
|
|
'pullquote',
|
|
|
|
'quote',
|
|
|
|
'separator',
|
|
|
|
'social-links',
|
|
|
|
'spacer',
|
|
|
|
'table',
|
|
|
|
'text-columns',
|
|
|
|
'verse',
|
|
|
|
'video',
|
2020-07-01 14:29:03 +02:00
|
|
|
);
|
2020-07-02 19:22:03 +02:00
|
|
|
|
|
|
|
foreach ( $block_folders as $block_folder ) {
|
2021-05-19 15:52:00 +02:00
|
|
|
register_block_type(
|
2020-07-02 19:22:03 +02:00
|
|
|
ABSPATH . WPINC . '/blocks/' . $block_folder
|
|
|
|
);
|
|
|
|
}
|
2020-07-01 14:29:03 +02:00
|
|
|
}
|
2020-07-02 19:22:03 +02:00
|
|
|
add_action( 'init', 'register_core_block_types_from_metadata' );
|