diff --git a/wp-includes/class-wp-block-styles-registry.php b/wp-includes/class-wp-block-styles-registry.php index df6945fd34..e95f7bf361 100644 --- a/wp-includes/class-wp-block-styles-registry.php +++ b/wp-includes/class-wp-block-styles-registry.php @@ -36,7 +36,7 @@ final class WP_Block_Styles_Registry { * * @param string $block_name Block type name including namespace. * @param array $style_properties Array containing the properties of the style name, label, - * style (name of the stylesheet to be enqueued), + * is_default, style_handle (name of the stylesheet to be enqueued), * inline_style (string containing the CSS to be added). * @return bool True if the block style was registered with success and false otherwise. */ diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 2d18f87415..47a75a1603 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -2303,15 +2303,17 @@ function enqueue_editor_block_styles_assets() { $register_script_lines = array( '( function() {' ); foreach ( $block_styles as $block_name => $styles ) { foreach ( $styles as $style_properties ) { + $block_style = array( + 'name' => $style_properties['name'], + 'label' => $style_properties['label'], + ); + if ( isset( $style_properties['is_default'] ) ) { + $block_style['isDefault'] = $style_properties['is_default']; + } $register_script_lines[] = sprintf( ' wp.blocks.registerBlockStyle( \'%s\', %s );', $block_name, - wp_json_encode( - array( - 'name' => $style_properties['name'], - 'label' => $style_properties['label'], - ) - ) + wp_json_encode( $block_style ) ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 1da5f8bc7b..38d9999d5f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50702'; +$wp_version = '5.8-alpha-50703'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.