# is_active_sidebar()

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

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

## Сигнатура

```php
is_active_sidebar( string|int $index ): bool
```

## Описание

Дополнительные сведения об этой и похожих функциях темы см. в статье о Conditional Tags в Theme Developer Handbook.

## Параметры

- `$index` `string|int` — обязательный. Имя, ID или номер боковой панели для проверки.

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

`bool`

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

Файл: `wp-includes/widgets.php:983`

```php
function is_active_sidebar( $index ) {
	$index             = ( is_int( $index ) ) ? "sidebar-$index" : sanitize_title( $index );
	$sidebars_widgets  = wp_get_sidebars_widgets();
	$is_active_sidebar = ! empty( $sidebars_widgets[ $index ] );

	/**
	 * Filters whether a dynamic sidebar is considered "active".
	 *
	 * @since 3.9.0
	 *
	 * @param bool       $is_active_sidebar Whether or not the sidebar should be considered "active".
	 *                                      In other words, whether the sidebar contains any widgets.
	 * @param int|string $index             Index, name, or ID of the dynamic sidebar.
	 */
	return apply_filters( 'is_active_sidebar', $is_active_sidebar, $index );
}
```

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

- 2.8.0 — Introduced.

## Связанные

Использует: [`sanitize_title`](https://chugunov.pro/api-wordpress/functions/sanitize_title/), [`wp_get_sidebars_widgets`](https://chugunov.pro/api-wordpress/functions/wp_get_sidebars_widgets/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).

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