Skip to content

Commit

Permalink
compat/6.1: get_style_nodes add missing backport
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 15, 2022
1 parent 77c14ab commit fdb76a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/compat/wordpress-6.2/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -1903,9 +1903,11 @@ protected static function get_style_nodes( $theme_json, $selectors = array() ) {

if ( isset( $theme_json['styles']['elements'] ) ) {
foreach ( self::ELEMENTS as $element => $selector ) {
if ( ! isset( $theme_json['styles']['elements'][ $element ] ) ) {
if ( ! isset( $theme_json['styles']['elements'][ $element ] ) || ! array_key_exists( $element, static::ELEMENTS ) ) {
continue;
}

// Handle element defaults.
$nodes[] = array(
'path' => array( 'styles', 'elements', $element ),
'selector' => static::ELEMENTS[ $element ],
Expand Down

0 comments on commit fdb76a5

Please sign in to comment.