WP_Theme_JSON::get_settings(): array

In this article

Returns the existing settings for each block.

Description

Example:

{
  'root': {
    'color': {
      'custom': true
    }
  },
  'core/paragraph': {
    'spacing': {
      'customPadding': true
    }
  }
}

Return

array Settings per block.

Source


foreach ( $blocks as $block_name => $block_type ) {
	$root_selector = wp_get_block_css_selector( $block_type );

	static::$blocks_metadata[ $block_name ]['selector']  = $root_selector;
	static::$blocks_metadata[ $block_name ]['selectors'] = static::get_block_selectors( $block_type, $root_selector );

Changelog

VersionDescription
5.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.