Skip to content

Commit

Permalink
let core blocks skip the file_exists check
Browse files Browse the repository at this point in the history
  • Loading branch information
mreishus committed Sep 27, 2024
1 parent 4f54092 commit e53dc25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) {
trailingslashit( $file_or_folder ) . 'block.json' :
$file_or_folder;

$metadata_file_exists = file_exists( $metadata_file );
$is_core_block = str_starts_with( $file_or_folder, ABSPATH . WPINC );
$metadata_file_exists = $is_core_block || file_exists( $metadata_file );
$registry_metadata = WP_Block_Metadata_Registry::get_metadata( $file_or_folder );

if ( $registry_metadata ) {
Expand Down

0 comments on commit e53dc25

Please sign in to comment.