There are four sources of data (origins) for a site: <ul> <li>default => WordPress</li> <li>blocks => each one of the blocks provides data for itself</li> <li>theme => the active theme</li> <li>custom => data provided by the user</li> </ul> The custom's has higher priority than the theme's, the theme's higher than blocks', and block's higher than default's. Unlike the getters <a href="https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_core_data/">https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_core_data/</a> get_core_data, <a href="https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_theme_data/">https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_theme_data/</a> get_theme_data, and <a href="https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_user_data/">https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_user_data/</a> get_user_data, this method returns data after it has been merged with the previous origins.This means that if the same piece of data is declared in different origins (default, blocks, theme, custom), the last origin overrides the previous. For example, if the user has set a background color for the paragraph block, and the theme has done it as well, the user preference wins.
Parameters
$originstringoptional
To what level should we merge data: 'default', 'blocks', 'theme' or 'custom'. 'custom' is used as default value as well as fallback value if the origin is unknown.Default: 'custom'
Return
WP_Theme_JSON
Uses · 6
_deprecated_argument()Marks a function argument as deprecated and inform when it has been used.
Signature, return type and hooks compared across 5 parsed releases.
6.2.0
Changed ' $origin' parameter values to 'default', 'blocks', 'theme' or 'custom'.from the docblock
6.1.0
Added block data and generation of spacingSizes array.from the docblock
5.9.0
Added user data, removed the $settings parameter, added the $origin parameter.from the docblock
5.8.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.7.7 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.