diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index f210858e55..f5541e0ae9 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -209,6 +209,22 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) { */ $metadata = apply_filters( 'block_type_metadata', $metadata ); + /** + * Add `style` and `editor_style` for core blocks if missing. + * + * @since 5.8.0 + */ + if ( ! empty( $metadata['name'] ) && 0 === strpos( $metadata['name'], 'core/' ) ) { + $block_name = str_replace( 'core/', '', $metadata['name'] ); + + if ( ! isset( $metadata['style'] ) ) { + $metadata['style'] = "wp-block-$block_name"; + } + if ( ! isset( $metadata['editor_style'] ) ) { + $metadata['editor_style'] = "wp-block-$block_name-editor"; + } + } + $settings = array(); $property_mappings = array( 'title' => 'title', diff --git a/wp-includes/version.php b/wp-includes/version.php index 8d7abc7838..4c0a7b8953 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-51101'; +$wp_version = '5.8-alpha-51102'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.