Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Jun 27, 2022
1 parent cfef497 commit 7be526c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/compat/wordpress-6.1/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ function gutenberg_block_type_metadata_multiple_view_scripts( $metadata ) {
}
add_filter( 'block_type_metadata', 'gutenberg_block_type_metadata_multiple_view_scripts' );


/**
* Allow multiple block styles.
*
Expand All @@ -169,10 +168,11 @@ function gutenberg_block_type_metadata_multiple_view_scripts( $metadata ) {
*
* @return array
*/
function gutenberg_multiple_block_styles_compat_61_( $metadata ) {
function gutenberg_multiple_block_styles_compat_6_1( $metadata ) {
foreach ( array( 'style', 'editorStyle' ) as $key ) {
if ( ! empty( $metadata[ $key ] ) && is_array( $metadata[ $key ] ) ) {
foreach ( $metadata[ $key ] as $handle ) {
// Do not enqueue style arrays such as { "color": { "text": "#fff" } }.
if ( is_array( $handle ) ) {
continue;
}
Expand Down Expand Up @@ -202,6 +202,7 @@ function gutenberg_multiple_block_styles_compat_61_( $metadata ) {
}
return $metadata;
}

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

0 comments on commit 7be526c

Please sign in to comment.