WP_Theme_JSON::get_settings() WordPress Method
The WP_Theme_JSON::get_settings() method is used to get the JSON encoded settings for a theme. This is useful if you need to store settings for a theme in a database or file.
WP_Theme_JSON::get_settings() #
Returns the existing settings for each block.
Contents
Description
Example:
{
'root': {
'color': {
'custom': true
}
},
'core/paragraph': {
'spacing': {
'customPadding': true
}
}
}
Return
(array) Settings per block.
Source
File: wp-includes/class-wp-theme-json.php
public function get_settings() { if ( ! isset( $this->theme_json['settings'] ) ) { return array(); } else { return $this->theme_json['settings']; } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.8.0 | Introduced. |