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
Rename to theme_json_file_data
  • Loading branch information
ockham committed Oct 5, 2022
commit 9665d71bde2b89fbe8dec56d8962e4a1d95cbe61
10 changes: 5 additions & 5 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,7 @@ class WP_Theme_JSON_Resolver {
* @var string
* @access private
*/
protected static $theme_json_data = null;
protected static $theme_json_file_data = null;

/**
* Processes a file that adheres to the theme.json schema
Expand Down Expand Up @@ -186,9 +186,9 @@ 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 ) {
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' ) );
if ( null === static::$theme_json_file_data ) {
static::$theme_json_file_data = static::read_json_file( static::get_file_path_from_theme( 'theme.json' ) );
static::$theme_json_file_data = static::translate( static::$theme_json_file_data, wp_get_theme()->get( 'TextDomain' ) );
}

/**
Expand All @@ -198,7 +198,7 @@ public static function get_theme_data( $deprecated = array(), $options = array()
*
* @param WP_Theme_JSON_Data Class to access and update the underlying data.
*/
$theme_json = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( static::$theme_json_data, 'theme' ) );
$theme_json = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( static::$theme_json_file_data, 'theme' ) );
$theme_json_data = $theme_json->get_data();
static::$theme = new WP_Theme_JSON( $theme_json_data );

Expand Down