WP_Theme_JSON_Resolver::get_merged_data( array $settings = array() )

There are different sources of data for a site: core and theme.

Description

While the getters get_core_data, get_theme_data return the raw data from the respective origins, this method merges them all together.

If the same piece of data is declared in different origins (core and theme), the last origin overrides the previous. For example, if core disables custom colors but a theme enables them, the theme config wins.

Parameters

$settings

(array) (Optional) Existing block editor settings.

Default value: array()

Return

(WP_Theme_JSON)

Source

File: wp-includes/class-wp-theme-json-resolver.php

public static function get_merged_data( $settings = array() ) {
		$theme_support_data = WP_Theme_JSON::get_from_editor_settings( $settings );

		$result = new WP_Theme_JSON();
		$result->merge( self::get_core_data() );
		$result->merge( self::get_theme_data( $theme_support_data ) );

		return $result;
	}

Changelog

Version Description
5.8.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_merged_data