diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 9d41509cc0..b59e76bcc6 100644 --- a/src/wp-includes/blocks.php +++ b/src/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;