Code Quality: Fix reported undefined `$script_uri` variable notice
The code editor reported this issue while mamduka was browsing the blocks.php file. PHP considers variables undefined until a value is assigned (or the global keyword is used). Follow-up for [53091]. Props mamaduka, peterwilsoncc. See 55567. Built from https://develop.svn.wordpress.org/trunk@53211 git-svn-id: http://core.svn.wordpress.org/trunk@52800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fba03a16ca
commit
83aed3ea4f
|
@ -113,13 +113,11 @@ function register_block_script_handle( $metadata, $field_name ) {
|
|||
$is_core_block = isset( $metadata['file'] ) && 0 === strpos( $metadata['file'], $wpinc_path_norm );
|
||||
$is_theme_block = 0 === strpos( $script_path_norm, $theme_path_norm );
|
||||
|
||||
$script_uri;
|
||||
$script_uri = plugins_url( $script_path, $metadata['file'] );
|
||||
if ( $is_core_block ) {
|
||||
$script_uri = includes_url( str_replace( $wpinc_path_norm, '', $script_path_norm ) );
|
||||
} elseif ( $is_theme_block ) {
|
||||
$script_uri = get_theme_file_uri( str_replace( $theme_path_norm, '', $script_path_norm ) );
|
||||
} else {
|
||||
$script_uri = plugins_url( $script_path, $metadata['file'] );
|
||||
}
|
||||
|
||||
$script_asset = require $script_asset_path;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.0-beta1-53210';
|
||||
$wp_version = '6.0-beta1-53211';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue