WP_Theme_JSON_Data::update_with()publicWP 6.1.0

Updates the theme.json with the the given data.

Method of the class: WP_Theme_JSON_Data{}

No Hooks.

Return

WP_Theme_JSON_Data. The own instance with access to the modified data.

Usage

$WP_Theme_JSON_Data = new WP_Theme_JSON_Data();
$WP_Theme_JSON_Data->update_with( $new_data );
$new_data(array) (required)
Array following the theme.json specification.

Changelog

Since 6.1.0 Introduced.

WP_Theme_JSON_Data::update_with() code WP 6.5.4

public function update_with( $new_data ) {
	$this->theme_json->merge( new WP_Theme_JSON( $new_data, $this->origin ) );
	return $this;
}