WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/23/2021 12:25:14 AM (4 months ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r51203 r51213  
    311311    $editor_settings['__experimentalFeatures'] = $theme_json->get_settings();
    312312    // These settings may need to be updated based on data coming from theme.json sources.
    313     if ( isset( $settings['__experimentalFeatures']['color']['palette'] ) ) {
    314         $colors_by_origin   = $settings['__experimentalFeatures']['color']['palette'];
    315         $settings['colors'] = isset( $colors_by_origin['user'] ) ?
     313    if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) {
     314        $colors_by_origin          = $editor_settings['__experimentalFeatures']['color']['palette'];
     315        $editor_settings['colors'] = isset( $colors_by_origin['user'] ) ?
    316316            $colors_by_origin['user'] : (
    317317                isset( $colors_by_origin['theme'] ) ?
     
    320320            );
    321321    }
    322     if ( isset( $settings['__experimentalFeatures']['color']['gradients'] ) ) {
    323         $gradients_by_origin   = $settings['__experimentalFeatures']['color']['gradients'];
    324         $settings['gradients'] = isset( $gradients_by_origin['user'] ) ?
     322    if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) {
     323        $gradients_by_origin          = $editor_settings['__experimentalFeatures']['color']['gradients'];
     324        $editor_settings['gradients'] = isset( $gradients_by_origin['user'] ) ?
    325325            $gradients_by_origin['user'] : (
    326326                isset( $gradients_by_origin['theme'] ) ?
     
    329329            );
    330330    }
    331     if ( isset( $settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {
    332         $font_sizes_by_origin  = $settings['__experimentalFeatures']['typography']['fontSizes'];
    333         $settings['fontSizes'] = isset( $font_sizes_by_origin['user'] ) ?
     331    if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {
     332        $font_sizes_by_origin         = $editor_settings['__experimentalFeatures']['typography']['fontSizes'];
     333        $editor_settings['fontSizes'] = isset( $font_sizes_by_origin['user'] ) ?
    334334            $font_sizes_by_origin['user'] : (
    335335                isset( $font_sizes_by_origin['theme'] ) ?
Note: See TracChangeset for help on using the changeset viewer.