WP_Theme_JSON::replace_slug_in_string()
Transforms a slug into a CSS Custom Property.
Метод класса: WP_Theme_JSON{}
Хуков нет.
Возвращает
Строку
. The CSS Custom Property. Something along the lines of --wp--preset--color--black.
Использование
$result = WP_Theme_JSON::replace_slug_in_string( $input, $slug );
- $input(строка) (обязательный)
- String to replace.
- $slug(строка) (обязательный)
- The slug value to use to generate the custom property.
Список изменений
С версии 5.9.0 | Введена. |
Код WP_Theme_JSON::replace_slug_in_string() WP Theme JSON::replace slug in string WP 6.5.2
protected static function replace_slug_in_string( $input, $slug ) { return strtr( $input, array( '$slug' => $slug ) ); }