WP_Theme_JSON_Data::__constructpublicWP 6.1.0

Constructor.

Method of the class: WP_Theme_JSON_Data{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WP_Theme_JSON_Data = new WP_Theme_JSON_Data();
$WP_Theme_JSON_Data->__construct( $data, $origin );
$data(array)
Array following the theme.json specification.
Default: array( foo
$origin(string)
The origin of the data: default, theme, user.
Default: 'theme'

Changelog

Since 6.1.0 Introduced.

WP_Theme_JSON_Data::__construct() code WP 6.8.1

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 );
}