WP_Theme_JSON::compute_preset_vars( array $settings, string[] $origins ): array

In this article

Given the block settings, extracts the CSS Custom Properties for the presets and adds them to the $declarations array following the format:

Description

array( ‘name’ => ‘property_name’, ‘value’ => ‘property_value, )

Parameters

$settingsarrayrequired
Settings to process.
$originsstring[]required
List of origins to process.

Return

array The modified $declarations.

Source

							$base_style_rule['selector']
						);
						$block_rules    .= static::to_ruleset( $layout_selector, $declarations );
					}
				}
			}
		}
	}
	return $block_rules;
}

/**
 * Creates new rulesets as classes for each preset value such as:
 *

Changelog

VersionDescription
5.9.0Added the $origins parameter.
5.8.0Introduced.

User Contributed Notes

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