A WordPress-centric search engine for devs and theme authors



register_core_block_types_from_metadata ›

Since5.5.0
Deprecatedn/a
register_core_block_types_from_metadata ( No parameters )
Defined at:
Codex:

Registers core block types using metadata files.

Dynamic core blocks are registered separately.


Source

function register_core_block_types_from_metadata() {
	$block_folders = array(
		'audio',
		'button',
		'buttons',
		'classic',
		'code',
		'column',
		'columns',
		'embed',
		'file',
		'gallery',
		'group',
		'heading',
		'html',
		'image',
		'list',
		'media-text',
		'missing',
		'more',
		'nextpage',
		'paragraph',
		'preformatted',
		'pullquote',
		'quote',
		'separator',
		'social-links',
		'spacer',
		'subhead',
		'table',
		'text-columns',
		'verse',
		'video',
	);

	foreach ( $block_folders as $block_folder ) {
		register_block_type_from_metadata(
			ABSPATH . WPINC . '/blocks/' . $block_folder
		);
	}
}