WPDev.one
Core Class

WP_Theme_JSON_Resolver

class WP_Theme_JSON_Resolver // Constructor: function Object() { [native code] }

Class that abstracts the processing of the different data sources

Methods 22 methods

Method / Return Description
read_json_file()
array

Processes a file that adheres to the theme.json schema

Parameters: $file_path: mixed
get_fields_to_translate()
array

Returns a data structure used in theme.json translation.

translate()
array

Given a theme.json structure modifies it in place to update certain values

Parameters: $theme_json: mixed, $domain: mixed
get_core_data()
WP_Theme_JSON

Returns core's origin config.

has_same_registered_blocks()
bool

Checks whether the registered blocks were already processed for this origin.

Parameters: $origin: mixed
get_theme_data()
WP_Theme_JSON

Returns the theme's data.

Parameters: $deprecated: mixed, $options: mixed
get_block_data()
WP_Theme_JSON

Gets the styles for blocks from the block.json file.

remove_json_comments()
array

When given an array, this will remove any keys with the name `//`.

Parameters: $input_array: mixed
get_user_data_from_wp_global_styles()
array

Returns the custom post type that contains the user's origin config

Parameters: $theme: mixed, $create_post: mixed, $post_status_filter: mixed
get_user_data()
WP_Theme_JSON

Returns the user's origin config.

get_merged_data()
WP_Theme_JSON

Returns the data merged from multiple origins.

Parameters: $origin: mixed
get_user_global_styles_post_id()
(integer

Returns the ID of the custom post type

theme_has_support()
bool

Determines whether the active theme has a theme.json file.

get_file_path_from_theme()
string

Builds the path to the given file and checks that it is readable.

Parameters: $file_name: mixed, $template: mixed
clean_cached_data()
void

Cleans the cached data so it can be recalculated.

recursively_iterate_json()
array

Returns an array of all nested JSON files within a given directory.

Parameters: $dir: mixed
style_variation_has_scope()
boolean

Determines if a supplied style variation matches the provided scope.

Parameters: $variation: mixed, $scope: mixed
get_style_variations()
array

Returns the style variations defined by the theme.

Parameters: $scope: mixed
get_resolved_theme_uris()
array

Resolves relative paths in theme.json styles to theme absolute paths

Parameters: $theme_json: mixed
resolve_theme_file_uris()
WP_Theme_JSON

Resolves relative paths in theme.json styles to theme absolute paths

Parameters: $theme_json: mixed
inject_variations_from_block_style_variation_files()
array

Adds variations sourced from block style variations files to the supplied theme.json data.

Parameters: $data: mixed, $variations: mixed
inject_variations_from_block_styles_registry()
array

Adds variations sourced from the block styles registry to the supplied theme.json data.

Parameters: $data: mixed

Properties

Property / Type Description
$blocks_cache
mixed
public
No description available.
$core
mixed
public
No description available.
$blocks
mixed
public
No description available.
$theme
mixed
public
No description available.
$user
mixed
public
No description available.
$user_custom_post_type_id
mixed
public
No description available.
$i18n_schema
mixed
public
No description available.
$theme_json_file_cache
mixed
public
No description available.

Class Information

Source File
wp-includes/class-wp-theme-json-resolver.php
Advertisement