WP_Theme_JSON::replace_slug_in_string( string $input, string $slug ): string

In this article

Transforms a slug into a CSS Custom Property.

Parameters

$inputstringrequired
String to replace.
$slugstringrequired
The slug value to use to generate the custom property.

Return

string The CSS Custom Property. Something along the lines of --wp--preset--color--black.

Source

	in_array( $layout_definition['displayMode'], $valid_display_modes, true )
) {
	$layout_selector = sprintf(

Changelog

VersionDescription
5.9.0Introduced.

User Contributed Notes

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