WP_Theme_JSON::replace_slug_in_string() – Transform a slug into a CSS Custom Property.

You appear to be a bot. Output may be restricted

Description

Transform a slug into a CSS Custom Property.

Usage

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

Parameters

$input
( string ) required – String to replace.
$slug
( string ) required – The slug value to use to generate the custom property.

Returns

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

Source

File name: wordpress/wp-includes/class-wp-theme-json.php
Lines:

1 to 3 of 3
  protected static function replace_slug_in_string( $input, $slug ) {
    return strtr( $input, array( '$slug' => $slug ) );
  }
 

 View on GitHub View on Trac