WP_Theme_JSON::update_separator_declarations( array $declarations ): array

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Returns a filtered declarations array if there is a separator block with only a background style defined in theme.json by adding a color attribute to reflect the changes in the front.

Parameters

$declarationsarrayrequired
List of declarations.

Return

array $declarations List of declarations filtered.

Source

 *       ],
 *     ]
 *
 * @since 5.8.0
 *
 * @param array $theme_json The tree to extract setting nodes from.
 * @param array $selectors  List of selectors per block.
 * @return array An array of setting nodes metadata.
 */
protected static function get_setting_nodes( $theme_json, $selectors = array() ) {
	$nodes = array();
	if ( ! isset( $theme_json['settings'] ) ) {
		return $nodes;
	}

	// Top-level.
	$nodes[] = array(
		'path'     => array( 'settings' ),
		'selector' => static::ROOT_BLOCK_SELECTOR,
	);

	// Calculate paths for blocks.
	if ( ! isset( $theme_json['settings']['blocks'] ) ) {
		return $nodes;
	}

	foreach ( $theme_json['settings']['blocks'] as $name => $node ) {
		$selector = null;

Changelog

VersionDescription
6.1.1Introduced.

User Contributed Notes

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