WP_Theme_JSON::convert_custom_properties( string $value ): string

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.

This is used to convert the internal representation of variables to the CSS representation.

Description

For example, var:preset|color|vivid-green-cyan becomes var(--wp--preset--color--vivid-green-cyan).

Parameters

$valuestringrequired
The variable such as var:preset|color|vivid-green-cyan to convert.

Return

string The converted variable.

Source

}

$setting_nodes = static::get_setting_nodes( $theme_json );
foreach ( $setting_nodes as $metadata ) {
	$input = _wp_array_get( $theme_json, $metadata['path'], array() );
	if ( empty( $input ) ) {
		continue;
	}

	$output = static::remove_insecure_settings( $input );
	if ( ! empty( $output ) ) {
		_wp_array_set( $sanitized, $metadata['path'], $output );
	}
}

if ( empty( $sanitized['styles'] ) ) {

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

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