Make WordPress Core


Ignore:
Timestamp:
05/11/2026 03:16:33 AM (4 months ago)
Author:
ramonopoly
Message:

[REVERT] WP_Theme_JSON: Prevent implicit coercion in to_ruleset

Reverts r62347. The fix the patch proposes is destined for 7.1. There is a general block for such patches until the 7.0 general release.

Props ramonopoly, andrewserong, westonruter.

See #64848.

File:
1 edited

Legend:

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

    r62347 r62348  
    19831983         *
    19841984         * @since 5.8.0
    1985          * @since 7.1.0 Skip declarations whose value is not a plain string (booleans, arrays, objects, etc.).
    19861985         *
    19871986         * @param string $selector     CSS selector.
     
    19971996                        $declarations,
    19981997                        static function ( $carry, $element ) {
    1999                                 $value = $element['value'];
    2000 
    2001                                 if ( is_numeric( $value ) ) {
    2002                                         $value = (string) $value;
    2003                                 }
    2004 
    2005                                 if ( ! is_string( $value ) ) {
    2006                                         return $carry;
    2007                                 }
    2008 
    2009                                 return $carry .= $element['name'] . ': ' . $value . ';';
    2010                         },
     1998                                return $carry .= $element['name'] . ': ' . $element['value'] . ';'; },
    20111999                        ''
    20122000                );
Note: See TracChangeset for help on using the changeset viewer.