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.


Top ↑

Return

(bool) True if the sidebar is registered, false otherwise.


Top ↑

Source

File: wp-includes/widgets.php

function is_registered_sidebar( $sidebar_id ) {
	global $wp_registered_sidebars;

	return isset( $wp_registered_sidebars[ $sidebar_id ] );
}


Top ↑

Changelog

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