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

*
* @param string $scope    Selector to scope to.
* @param string $selector Original selector.

Changelog

VersionDescription
5.9.0Introduced.

User Contributed Notes

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