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.


Parameters

$sidebar_id

(string|int)(Required)The ID of the sidebar when it was registered.


Top ↑

Source

File: wp-includes/widgets.php

function unregister_sidebar( $sidebar_id ) {
	global $wp_registered_sidebars;

	unset( $wp_registered_sidebars[ $sidebar_id ] );
}

Top ↑

Changelog

Changelog
VersionDescription
2.2.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.