unregister_sidebar() WordPress Function
The unregister_sidebar() function is used to unregister a sidebar in WordPress. This function takes a single parameter, which is the ID of the sidebar to unregister.
unregister_sidebar( string|int $sidebar_id ) #
Removes a sidebar from the list.
Contents
Parameters
- $sidebar_id
(string|int)(Required)The ID of the sidebar when it was registered.
Source
File: wp-includes/widgets.php
function unregister_sidebar( $sidebar_id ) {
global $wp_registered_sidebars;
unset( $wp_registered_sidebars[ $sidebar_id ] );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 2.2.0 | Introduced. |