wppaste
WordPress

WP_Theme_JSON_Resolver

Source
wp-includes/class-wp-theme-json-resolver.php:20
Class that abstracts the processing of the different data sources for site-level config and offers an API to work with them.

Description

This class is for internal core usage and is not supposed to be used by extenders (plugins and/or themes).
This is a low-level API that may need to do breaking changes. Please, use get_global_settings(), get_global_styles(), and get_global_stylesheet() instead.

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 5

Every hook that fires from inside WP_Theme_JSON_Resolver, in the order it appears in the class, grouped by the method that fires it.

Properties · 8

$blocks_cachearrayprotected static
Container for keep track of registered blocks.
$coreWP_Theme_JSONprotected static
Container for data coming from core.
$blocksWP_Theme_JSONprotected static
Container for data coming from the blocks.
$themeWP_Theme_JSONprotected static
Container for data coming from the theme.
$userWP_Theme_JSONprotected static
Container for data coming from the user.
$user_custom_post_type_idintprotected static
Stores the ID of the custom post type that holds the user data.
$i18n_schemaarrayprotected static
Container to keep loaded i18n schema for theme.json.
$theme_json_file_cachearrayprotected static
theme.json file cache.

Methods · 22

Source code

#[AllowDynamicProperties]class WP_Theme_JSON_Resolver { 	/**	 * Container for keep track of registered blocks.	 *	 * @since 6.1.0	 * @var array	 */	protected static $blocks_cache = array(		'core'   => array(),		'blocks' => array(),		'theme'  => array(),		'user'   => array(),	); 	/**	 * Container for data coming from core.	 *	 * @since 5.8.0	 * @var WP_Theme_JSON	 */	protected static $core = null; 	/**	 * Container for data coming from the blocks.	 *	 * @since 6.1.0	 * @var WP_Theme_JSON	 */	protected static $blocks = null; 	/**	 * Container for data coming from the theme.	 *	 * @since 5.8.0	 * @var WP_Theme_JSON	 */	protected static $theme = null; 	/**	 * Container for data coming from the user.	 *	 * @since 5.9.0	 * @var WP_Theme_JSON	 */	protected static $user = null; 	/**	 * Stores the ID of the custom post type	 * that holds the user data.	 *	 * @since 5.9.0	 * @var int	 */	protected static $user_custom_post_type_id = null; 	/**	 * Container to keep loaded i18n schema for `theme.json`.	 *	 * @since 5.8.0 As `$theme_json_i18n`.	 * @since 5.9.0 Renamed from `$theme_json_i18n` to `$i18n_schema`.	 * @var array	 */	protected static $i18n_schema = null; 	/**	 * `theme.json` file cache.	 *	 * @since 6.1.0	 * @var array	 */	protected static $theme_json_file_cache = array(); 	/**	 * Processes a file that adheres to the theme.json schema	 * and returns an array with its contents, or a void array if none found.	 *	 * @since 5.8.0	 * @since 6.1.0 Added caching.

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/class-wp-theme-json-resolver.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.