Skip to content

Commit b0ae335

Browse files
committed
Enqueue all style handles and not just the first one
1 parent 4182701 commit b0ae335

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/compat/wordpress-6.0/client-assets.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ function gutenberg_resolve_assets() {
6262
foreach ( $block_registry->get_all_registered() as $block_type ) {
6363
if ( ! empty( $block_type->style ) ) {
6464
if ( is_array( $block_type->style ) ) {
65-
$style_handles[] = $block_type->style[0];
65+
foreach ( $block_type->style as $single_style ) {
66+
if ( is_string( $single_style ) ) {
67+
$style_handles[] = $single_style;
68+
}
69+
}
6670
} else {
6771
$style_handles[] = $block_type->style;
6872
}

lib/compat/wordpress-6.1/blocks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,6 @@ function gutenberg_multiple_block_styles_compat_6_1( $metadata ) {
203203
return $metadata;
204204
}
205205

206-
remove_filter( 'block_type_metadata', 'gutenberg_multiple_block_styles' );
206+
remove_filter( 'block_type_metadata', '_wp_multiple_block_styles' );
207207
remove_filter( 'block_type_metadata', 'gutenberg_multiple_block_styles' );
208208
add_filter( 'block_type_metadata', 'gutenberg_multiple_block_styles_compat_6_1', 9 );

0 commit comments

Comments
 (0)