wp-includes/class-wp-theme-json.php:2298Given an array of settings, extracts the CSS Custom Properties for the custom values and adds them to the $declarations array following the format:
$settingsarrayarray protected static function compute_theme_vars( $settings ) { $declarations = array(); $custom_values = $settings['custom'] ?? array(); $css_vars = static::flatten_tree( $custom_values ); foreach ( $css_vars as $key => $value ) { $declarations[] = array( 'name' => '--wp--custom--' . $key, 'value' => $value, ); } return $declarations; }Introduced in 5.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-theme-json.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.