diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php
index 1dc1e66230..84d36c626d 100644
a
|
b
|
function register_block_type_from_metadata( $file_or_folder, $args = array() ) { |
531 | 531 | $processed_styles[] = $result; |
532 | 532 | } |
533 | 533 | } |
| 534 | |
| 535 | // we should put "wp-block-{$block_name}-theme" before styles from theme.json and any other styles, |
| 536 | // since these styles are default, so we should have opportunity to override it |
| 537 | if ( in_array( "wp-block-{$block_name}-theme", $processed_styles ) ) { |
| 538 | $processed_styles = array_diff( $processed_styles, array( "wp-block-{$block_name}-theme" ) ); |
| 539 | array_unshift( $processed_styles, "wp-block-{$block_name}-theme" ); |
| 540 | } |
534 | 541 | $settings[ $settings_field_name ] = $processed_styles; |
535 | 542 | } |
536 | 543 | } |