From 83aed3ea4f96e665741b8c417f6e6cc79299bf3b Mon Sep 17 00:00:00 2001 From: gziolo Date: Tue, 19 Apr 2022 09:58:07 +0000 Subject: [PATCH] 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 --- wp-includes/blocks.php | 4 +--- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index 9d41509cc0..b59e76bcc6 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -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; diff --git a/wp-includes/version.php b/wp-includes/version.php index 1aac36c192..965e508f28 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.