WP_Theme_JSON::get_settings()

Returns the existing settings for each block.

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'];
		}
	}

Changelog

Version Description
5.8.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json/get_settings