Skip to content

Commit

Permalink
Collect element style nodes in the order they're defined in ELEMENTS …
Browse files Browse the repository at this point in the history
…and not in theme.json
  • Loading branch information
adamziel committed Jul 4, 2022
1 parent 1f01087 commit 0da5f58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,10 @@ protected static function get_style_nodes( $theme_json, $selectors = array() ) {
);

if ( isset( $theme_json['styles']['elements'] ) ) {

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

// Handle element defaults.
$nodes[] = array(
Expand Down

0 comments on commit 0da5f58

Please sign in to comment.