is_active_sidebar WordPress Filter Hook

The is_active_sidebar hook is a conditional hook that allows you to check if a sidebar is active before running any code that relies on it. This can be useful for customizing your sidebar output or for conditionally loading sidebar-specific code.

apply_filters( 'is_active_sidebar', bool $is_active_sidebar, int|string $index ) #

Filters whether a dynamic sidebar is considered “active”.


Parameters

$is_active_sidebar

(bool)Whether or not the sidebar should be considered "active". In other words, whether the sidebar contains any widgets.

$index

(int|string)Index, name, or ID of the dynamic sidebar.


Top ↑

Source

File: wp-includes/widgets.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.