wordpress / latest / classes / wp_theme_json_data / __construct.html

WP_Theme_JSON_Data::__construct( array $data = array(), string $origin = 'theme' )

Constructor.

Parameters

$data array Optional
Array following the theme.json specification.

Default: array()

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

Default: 'theme'

Source

File: wp-includes/class-wp-theme-json-data.php. View all references

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

Used By

Used By Description

Changelog

Version Description
6.1.0 Introduced.

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