diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index 8962680c53..5b8871d3f7 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -107,19 +107,19 @@ function register_block_script_handle( $metadata, $field_name, $index = 0 ) { return $script_handle; } - $script_handle = generate_block_asset_handle( $metadata['name'], $field_name, $index ); - $script_asset_path = wp_normalize_path( - realpath( - dirname( $metadata['file'] ) . '/' . - substr_replace( $script_path, '.asset.php', - strlen( '.js' ) ) - ) + $script_asset_raw_path = dirname( $metadata['file'] ) . '/' . substr_replace( $script_path, '.asset.php', - strlen( '.js' ) ); + $script_handle = generate_block_asset_handle( $metadata['name'], $field_name, $index ); + $script_asset_path = wp_normalize_path( + realpath( $script_asset_raw_path ) ); - if ( ! file_exists( $script_asset_path ) ) { + + if ( empty( $script_asset_path ) ) { _doing_it_wrong( __FUNCTION__, sprintf( - /* translators: 1: Field name, 2: Block name. */ - __( 'The asset file for the "%1$s" defined in "%2$s" block definition is missing.' ), + /* translators: 1: Asset file location, 2: Field name, 3: Block name. */ + __( 'The asset file (%1$s) for the "%2$s" defined in "%3$s" block definition is missing.' ), + $script_asset_raw_path, $field_name, $metadata['name'] ), diff --git a/wp-includes/version.php b/wp-includes/version.php index b779ab9a14..4f2a5c5f95 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-beta3-55445'; +$wp_version = '6.2-beta3-55446'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.