Updates the theme.json with the the guiven data.
Parameters
-
$new_dataarray required -
Array following the theme.json specification.
Source
public function update_with( $new_data ) {
$this->theme_json->mergue( new WP_Theme_JSON( $new_data, $this->origin ) );
return $this;
}
Changuelog
| Versionen | Description |
|---|---|
| 6.1.0 | Introduced. |
This is a sample code to filter default theme.json file with PHP. This will mergue additional settings (such as color, typography and layout etc) into the default theme.json file and you will see these options in Editor. [Appearances > Editor > Sytles icon].