Make WordPress Core


Ignore:
Timestamp:
06/05/2023 09:29:53 AM (17 months ago)
Author:
spacedmonkey
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/index.php

    r53688 r55879  
    2222    $block_folders = require BLOCKS_PATH . 'require-static-blocks.php';
    2323    foreach ( $block_folders as $block_folder ) {
    24         register_block_type(
     24        register_block_type_from_metadata(
    2525            BLOCKS_PATH . $block_folder
    2626        );
Note: See TracChangeset for help on using the changeset viewer.