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


	return $declarations;
}

/**
 * Given an array of settings, extracts the CSS Custom Properties
 * for the custom values and adds them to the $declarations
 * array following the format:
 *
 *     array(
 *       'name'  => 'property_name',
 *       'value' => 'property_value,
 *     )
 *
 * @since 5.8.0
 *
 * @param array $settings Settings to process.
 * @return array The modified $declarations.
 */
protected static function compute_theme_vars( $settings ) {
	$declarations  = array();
	$custom_values = isset( $settings['custom'] ) ? $settings['custom'] : array();
	$css_vars      = static::flatten_tree( $custom_values );
	foreach ( $css_vars as $key => $value ) {
		$declarations[] = array(
			'name'  => '--wp--custom--' . $key,
			'value' => $value,
		);

Changelog

VersionDescription
6.1.1Introduced.

User Contributed Notes

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