Skip to content

Commit

Permalink
Enqueue all style handles and not just the first one
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Jun 27, 2022
1 parent 4182701 commit b0ae335
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/compat/wordpress-6.0/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ function gutenberg_resolve_assets() {
foreach ( $block_registry->get_all_registered() as $block_type ) {
if ( ! empty( $block_type->style ) ) {
if ( is_array( $block_type->style ) ) {
$style_handles[] = $block_type->style[0];
foreach ( $block_type->style as $single_style ) {
if ( is_string( $single_style ) ) {
$style_handles[] = $single_style;
}
}
} else {
$style_handles[] = $block_type->style;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.1/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,6 @@ function gutenberg_multiple_block_styles_compat_6_1( $metadata ) {
return $metadata;
}

remove_filter( 'block_type_metadata', 'gutenberg_multiple_block_styles' );
remove_filter( 'block_type_metadata', '_wp_multiple_block_styles' );
remove_filter( 'block_type_metadata', 'gutenberg_multiple_block_styles' );
add_filter( 'block_type_metadata', 'gutenberg_multiple_block_styles_compat_6_1', 9 );

0 comments on commit b0ae335

Please sign in to comment.