is_registered_sidebar() WordPress Function
The is_registered_sidebar() function checks whether a given sidebar is registered in the current theme. If the sidebar is registered, the function returns true. Otherwise, it returns false.
is_registered_sidebar( string|int $sidebar_id ) #
Checks if a sidebar is registered.
Parameters
- $sidebar_id
(string|int)(Required)The ID of the sidebar when it was registered.
Return
(bool) True if the sidebar is registered, false otherwise.
Source
File: wp-includes/widgets.php
function is_registered_sidebar( $sidebar_id ) {
global $wp_registered_sidebars;
return isset( $wp_registered_sidebars[ $sidebar_id ] );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |