Script Loader: Pass the asset path to the `_doing_it_wrong()` notice in `register_block_script_handle()`.
This changeset ensures the file path is correctly passed in the output from `_doing_it_wrong()` notice in `register_block_script_handle()`. Props desrosj, neychok, mahbubshovan, ironprogrammer, robinwpdeveloper, hellofromTonya, simongomes02, mukesh27, costdev. Fixes #53566. Built from https://develop.svn.wordpress.org/trunk@55446 git-svn-id: http://core.svn.wordpress.org/trunk@54979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0c81b800a4
commit
c4593442cd
|
@ -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']
|
||||
),
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue