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
$declarations
arrayrequired- List of declarations.
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
Version | Description |
---|---|
6.1.1 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.