From 821327ca7004a9d8dfd959246c5f3f0ea6ebfea3 Mon Sep 17 00:00:00 2001 From: desrosj Date: Wed, 23 Jun 2021 00:26:58 +0000 Subject: [PATCH] Editor: Correct variable names in `get_block_editor_settings()`. Incorrect variable names were leading to unreachable conditional statements. Follow up to [51149]. Props johnbillion, mukesh27. See #53458. Built from https://develop.svn.wordpress.org/trunk@51213 git-svn-id: http://core.svn.wordpress.org/trunk@50822 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-editor.php | 18 +++++++++--------- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-includes/block-editor.php b/wp-includes/block-editor.php index fc80ef3e1b..9b1aa739ad 100644 --- a/wp-includes/block-editor.php +++ b/wp-includes/block-editor.php @@ -310,27 +310,27 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex $editor_settings['__experimentalFeatures'] = $theme_json->get_settings(); // These settings may need to be updated based on data coming from theme.json sources. - if ( isset( $settings['__experimentalFeatures']['color']['palette'] ) ) { - $colors_by_origin = $settings['__experimentalFeatures']['color']['palette']; - $settings['colors'] = isset( $colors_by_origin['user'] ) ? + if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) { + $colors_by_origin = $editor_settings['__experimentalFeatures']['color']['palette']; + $editor_settings['colors'] = isset( $colors_by_origin['user'] ) ? $colors_by_origin['user'] : ( isset( $colors_by_origin['theme'] ) ? $colors_by_origin['theme'] : $colors_by_origin['core'] ); } - if ( isset( $settings['__experimentalFeatures']['color']['gradients'] ) ) { - $gradients_by_origin = $settings['__experimentalFeatures']['color']['gradients']; - $settings['gradients'] = isset( $gradients_by_origin['user'] ) ? + if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) { + $gradients_by_origin = $editor_settings['__experimentalFeatures']['color']['gradients']; + $editor_settings['gradients'] = isset( $gradients_by_origin['user'] ) ? $gradients_by_origin['user'] : ( isset( $gradients_by_origin['theme'] ) ? $gradients_by_origin['theme'] : $gradients_by_origin['core'] ); } - if ( isset( $settings['__experimentalFeatures']['typography']['fontSizes'] ) ) { - $font_sizes_by_origin = $settings['__experimentalFeatures']['typography']['fontSizes']; - $settings['fontSizes'] = isset( $font_sizes_by_origin['user'] ) ? + if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) { + $font_sizes_by_origin = $editor_settings['__experimentalFeatures']['typography']['fontSizes']; + $editor_settings['fontSizes'] = isset( $font_sizes_by_origin['user'] ) ? $font_sizes_by_origin['user'] : ( isset( $font_sizes_by_origin['theme'] ) ? $font_sizes_by_origin['theme'] : diff --git a/wp-includes/version.php b/wp-includes/version.php index f2482c79ea..162a7238df 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta2-51212'; +$wp_version = '5.8-beta2-51213'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.