Editor: Use register_block_type_from_metadata in register_core_block_types_from_metadata.

Use `register_block_type_from_metadata` in `register_core_block_types_from_metadata` function instead of `register_block_type`. This saves an unnecessary call to `file_exists` in `register_block_type` as core block files will always exist. 

Props nihar007, spacedmonkey, mukesh27, gziolo, sudipatel007.
Fixes #58342.

git-svn-id: https://develop.svn.wordpress.org/trunk@55879 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonny Harris 2023-06-05 09:29:53 +00:00
parent 522a80a8fc
commit 537eb2145a

View File

@ -21,7 +21,7 @@ require BLOCKS_PATH . 'require-dynamic-blocks.php';
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(
register_block_type_from_metadata(
BLOCKS_PATH . $block_folder
);
}