# wp_enqueue_style()

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

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

## Сигнатура

```php
wp_enqueue_style( string $handle, string $src = '', string[] $deps = array(), string|bool|null $ver = false, string $media = 'all' )
```

## Описание

Registers the style if source provided (does NOT overwrite) and enqueues.[See also](#see-also)
- [WP_Dependencies::add()](https://developer.wordpress.org/reference/classes/WP_Dependencies/add/)

- [WP_Dependencies::enqueue()](https://developer.wordpress.org/reference/classes/WP_Dependencies/enqueue/)

## Параметры

- `$handle` `string` — обязательный. Имя таблицы стилей. Должно быть уникальным.
- `$src` `string` — необязательный, по умолчанию `''`. Полный URL таблицы стилей или путь к ней относительно корневого каталога WordPress.
- `$deps` `string[]` — необязательный, по умолчанию `array()`. Массив идентификаторов зарегистрированных таблиц стилей, от которых зависит эта таблица стилей.
- `$ver` `string|bool|null` — необязательный, по умолчанию `false`. Строка с номером версии таблицы стилей, если он есть, который добавляется к URL как строка запроса для сброса кэша. Если версия задана как false, автоматически добавляется номер версии, равный текущей установленной версии WordPress.
  
  Если задано null, версия не добавляется.
- `$media` `string` — необязательный, по умолчанию `'all'`. Тип носителя, для которого определена эта таблица стилей.
  
  По умолчанию 'all'. Принимает типы носителей, такие как 'all', 'print' и 'screen', или медиазапросы, такие как «(orientation: portrait)» и «(max-width: 640px)».

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

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

```php
function wp_enqueue_style( $handle, $src = '', $deps = array(), $ver = false, $media = 'all' ) {
	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );

	$wp_styles = wp_styles();

	if ( $src ) {
		$_handle = explode( '?', $handle );
		$wp_styles->add( $_handle[0], $src, $deps, $ver, $media );
	}

	$wp_styles->enqueue( $handle );
}
```

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

- 2.6.0 — Introduced.

## Связанные

Использует: [`wp_styles`](https://chugunov.pro/api-wordpress/functions/wp_styles/).
Используется в: [`wp_enqueue_view_transitions_admin_css`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_view_transitions_admin_css/), [`wp_options_connectors_wp_admin_enqueue_scripts`](https://chugunov.pro/api-wordpress/functions/wp_options_connectors_wp_admin_enqueue_scripts/), [`wp_options_connectors_render_page`](https://chugunov.pro/api-wordpress/functions/wp_options_connectors_render_page/), [`wp_font_library_render_page`](https://chugunov.pro/api-wordpress/functions/wp_font_library_render_page/), [`wp_font_library_wp_admin_enqueue_scripts`](https://chugunov.pro/api-wordpress/functions/wp_font_library_wp_admin_enqueue_scripts/), [`wp_enqueue_command_palette_assets`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_command_palette_assets/), [`wp_render_empty_block_template_warning`](https://chugunov.pro/api-wordpress/functions/wp_render_empty_block_template_warning/), `WP_Interactivity_API::data_wp_router_region_processor`, [`wp_enqueue_emoji_styles`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_emoji_styles/), [`wp_enqueue_embed_styles`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_embed_styles/), [`wp_enqueue_block_template_skip_link`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_block_template_skip_link/), `WP_Duotone::output_footer_assets`, [`wp_enqueue_classic_theme_styles`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_classic_theme_styles/), [`wp_enqueue_stored_styles`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_stored_styles/), [`_wp_get_iframed_editor_assets`](https://chugunov.pro/api-wordpress/functions/_wp_get_iframed_editor_assets/), [`_wp_theme_json_webfonts_handler`](https://chugunov.pro/api-wordpress/functions/_wp_theme_json_webfonts_handler/), [`wp_enqueue_global_styles_css_custom_properties`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_global_styles_css_custom_properties/), [`wp_enqueue_block_style`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_block_style/), [`wp_enqueue_editor_format_library_assets`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_editor_format_library_assets/), [`wp_enqueue_global_styles`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_global_styles/), `WP_Block::render`, [`wp_enqueue_editor_block_directory_assets`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_editor_block_directory_assets/), [`enqueue_block_styles_assets`](https://chugunov.pro/api-wordpress/functions/enqueue_block_styles_assets/), [`wp_common_block_scripts_and_styles`](https://chugunov.pro/api-wordpress/functions/wp_common_block_scripts_and_styles/), [`wp_enqueue_registered_block_scripts_and_styles`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_registered_block_scripts_and_styles/), [`register_and_do_post_meta_boxes`](https://chugunov.pro/api-wordpress/functions/register_and_do_post_meta_boxes/), [`wp_enqueue_code_editor`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_code_editor/), `_WP_Editors::enqueue_default_editor`, `WP_Widget_Media_Audio::enqueue_admin_scripts`, `WP_Widget_Media_Audio::enqueue_preview_scripts`, `WP_Widget_Media_Video::enqueue_preview_scripts`, `WP_Customize_Nav_Menus::enqueue_scripts`, [`login_header`](https://chugunov.pro/api-wordpress/functions/login_header/), [`wp_dashboard_setup`](https://chugunov.pro/api-wordpress/functions/wp_dashboard_setup/), `WP_Internal_Pointers::enqueue_scripts`, [`iframe_header`](https://chugunov.pro/api-wordpress/functions/iframe_header/), [`wp_iframe`](https://chugunov.pro/api-wordpress/functions/wp_iframe/), `Custom_Image_Header::css_includes`, `Custom_Background::admin_load`, `WP_Customize_Manager::customize_preview_init`.

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