Skip to content

Commit

Permalink
Don't return early in get_theme_data
Browse files Browse the repository at this point in the history
  • Loading branch information
joemcgill committed Sep 18, 2023
1 parent b477c3d commit a5922fe
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/wp-includes/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,10 @@ public static function get_theme_data( $deprecated = array(), $options = array()
return static::$theme;
}

$theme_support_data = self::get_theme_supports_data();
// Save theme supports data for future use.
static::$theme_support_data = self::get_theme_supports_data();

// If no support data has changed, return the previously cached object.
if ( $theme_support_data === static::$theme_support_data ) {
return static::$theme;
}

// Cache the merged theme support data for future use.
static::$theme_support_data = $theme_support_data;

$with_theme_supports = new WP_Theme_JSON( $theme_support_data );
$with_theme_supports = new WP_Theme_JSON( static::$theme_support_data );
$with_theme_supports->merge( static::$theme );
return $with_theme_supports;
}
Expand Down

0 comments on commit a5922fe

Please sign in to comment.