W3cubDocs

/WordPress

WP_Theme_JSON_Data::__construct( array $data = array(‘version’ => WP_Theme_JSON::LATEST_SCHEMA), string $origin = ‘theme’ )

Constructor.

Parameters

$dataarrayoptional
Array following the theme.json specification.

Default:array('version' => WP_Theme_JSON::LATEST_SCHEMA)

$originstringoptional
The origin of the data: default, theme, user.

Default:'theme'

Source

public function __construct( $data = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA ), $origin = 'theme' ) {
	$this->origin     = $origin;
	$this->theme_json = new WP_Theme_JSON( $data, $this->origin );
}

Changelog

Version Description
6.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json_data/__construct