Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Whitespace, variable use
  • Loading branch information
ockham committed Oct 5, 2022
commit e686c5f5c38b260e61d9af85addb95181bad772b
11 changes: 4 additions & 7 deletions src/wp-includes/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class WP_Theme_JSON_Resolver {
* @var string
* @access private
*/

protected static $theme_json_data = null;

/**
Expand Down Expand Up @@ -186,10 +185,10 @@ public static function get_theme_data( $deprecated = array(), $options = array()
}

$options = wp_parse_args( $options, array( 'with_supports' => true ) );
if ( null === static::$theme_json_data ) {

$theme_json_data = static::read_json_file( static::get_file_path_from_theme( 'theme.json' ) );
$theme_json_data = static::translate( $theme_json_data, wp_get_theme()->get( 'TextDomain' ) );
if ( null === static::$theme_json_data ) {
static::$theme_json_data = static::read_json_file( static::get_file_path_from_theme( 'theme.json' ) );
static::$theme_json_data = static::translate( static::$theme_json_data, wp_get_theme()->get( 'TextDomain' ) );

/**
* Filters the data provided by the theme for global styles & settings.
Expand All @@ -198,9 +197,7 @@ public static function get_theme_data( $deprecated = array(), $options = array()
*
* @param WP_Theme_JSON_Data Class to access and update the underlying data.
*/

static::$theme_json_data = $theme_json_data;
$theme_json = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) );
$theme_json = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( static::$theme_json_data, 'theme' ) );
$theme_json_data = $theme_json->get_data();
static::$theme = new WP_Theme_JSON( $theme_json_data );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test it with child themes.


Expand Down