diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index 3bdcdcc452..41b8430f98 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -326,13 +326,15 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) { trailingslashit( $file_or_folder ) . 'block.json' : $file_or_folder; - if ( ! file_exists( $metadata_file ) ) { + $is_core_block = str_starts_with( $file_or_folder, ABSPATH . WPINC ); + + if ( ! $is_core_block && ! file_exists( $metadata_file ) ) { return false; } // Try to get metadata from the static cache for core blocks. $metadata = false; - if ( str_starts_with( $file_or_folder, ABSPATH . WPINC ) ) { + if ( $is_core_block ) { $core_block_name = str_replace( ABSPATH . WPINC . '/blocks/', '', $file_or_folder ); if ( ! empty( $core_blocks_meta[ $core_block_name ] ) ) { $metadata = $core_blocks_meta[ $core_block_name ]; diff --git a/wp-includes/version.php b/wp-includes/version.php index 73014d8326..68ed4a2eea 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55909'; +$wp_version = '6.3-alpha-55910'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.