Skip to content

Commit 7e60782

Browse files
authored
Fix merging of script metadata for block types
1 parent bf4a526 commit 7e60782

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wp-scripts-assets-loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public function extend_block_type_metadata( $metadata ) {
284284
foreach ( [ 'editorScript', 'script', 'viewScript' ] as $script_type ) {
285285
if ( isset( $blocks[ $block_type ][ $script_type ] ) ) {
286286
$metadata[ $script_type ] = array_values( array_unique( array_merge(
287-
(array) ( $metadata['viewScript'] ?? [] ),
287+
(array) ( $metadata[ $script_type ] ?? [] ),
288288
array_map( function ( $script ) use ( $metadata, $block_path, $script_type ) {
289289
$meta_for_path = $metadata;
290290
$meta_for_path['file'] = $block_path;

0 commit comments

Comments
 (0)