Make WordPress Core


Ignore:
Timestamp:
07/08/2021 07:30:18 PM (2 years ago)
Author:
jorgefilipecosta
Message:

Block Editor: Fix for theme.json: color.duotone and spacing.units should allow empty sets.

This commit fixes an issue with the color.duotone & spacing.units in which empty values didn't override previous origins, resulting in that a theme couldn't provide an empty set for this via its theme.json.

Props nosolosw, youknowriad, aristath.
See #53175.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r51352 r51383  
    11071107            foreach ( $to_replace as $property_path ) {
    11081108                $path = array_merge( $metadata['path'], $property_path );
    1109                 $node = _wp_array_get( $incoming_data, $path, array() );
    1110                 if ( ! empty( $node ) ) {
     1109                $node = _wp_array_get( $incoming_data, $path, null );
     1110                if ( isset( $node ) ) {
    11111111                    _wp_array_set( $this->theme_json, $path, $node );
    11121112                }
Note: See TracChangeset for help on using the changeset viewer.