# wp_style_add_data()

URL: https://chugunov.pro/api-wordpress/functions/wp_style_add_data/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 3.6.0.

## Сигнатура

```php
wp_style_add_data( string $handle, string $key, mixed $value ): bool
```

## Описание

Works only if the stylesheet has already been registered.

Possible values for $key and $value: ‘rtl’ bool|string To declare an RTL stylesheet.
‘suffix’ string Optional suffix, used in combination with RTL.
‘alt’ bool For rel=”alternate stylesheet”.
‘title’ string For preferred/alternate stylesheets.
‘path’ string The absolute path to a stylesheet. Stylesheet will load inline when ‘path’ is set.[See also](#see-also)
- [WP_Dependencies::add_data()](https://developer.wordpress.org/reference/classes/WP_Dependencies/add_data/)

## Параметры

- `$handle` `string` — обязательный. Имя таблицы стилей.
- `$key` `string` — обязательный. Имя элемента данных, для которого сохраняется значение.
  
  Принимает 'rtl', 'suffix', 'alt', 'title' и 'path'.
- `$value` `mixed` — обязательный. Строка, содержащая добавляемые CSS-данные.

## Возвращаемое значение

`bool`

## Исходный код

Файл: `wp-includes/functions-wp-styles.php:244`

```php
function wp_style_add_data( $handle, $key, $value ) {
	return wp_styles()->add_data( $handle, $key, $value );
}
```

## История изменений

- 6.9.0 — 'conditional' value changed. If the 'conditional' parameter is present the stylesheet will be ignored.
- 5.8.0 — Added 'path' as an official value for $key. See wp_maybe_inline_styles().
- 3.6.0 — Introduced.

## Связанные

Использует: `WP_Styles::add_data`, `WP_Dependencies`, [`wp_styles`](https://chugunov.pro/api-wordpress/functions/wp_styles/).
Используется в: [`wp_enqueue_block_style`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_block_style/), [`register_block_style_handle`](https://chugunov.pro/api-wordpress/functions/register_block_style_handle/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_style_add_data/
