Make WordPress Core


Ignore:
Timestamp:
07/09/2021 01:05:05 AM (3 years ago)
Author:
desrosj
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, jorgefilipecosta.
Merges [51383] to the 5.8 branch.
Fixes #53175.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/class-wp-theme-json.php

    r51364 r51386  
    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.