WordPress at a glance

is_registered_sidebar() WP 1.0

Checks if a sidebar is registered.

  • Global. Array. $wp_registered_sidebars Registered sidebars.
✈ 1 time = 0.000013s = very fast | 50000 times = 0.02s = speed of light

No Hooks.

Return

true/false. True if the sidebar is registered, false otherwise.

Usage

is_registered_sidebar( $sidebar_id );
$sidebar_id(string/int) (required)
The ID of the sidebar when it was registered.

Code of is_registered_sidebar: wp-includes/widgets.php VER 4.9.8

<?php
function is_registered_sidebar( $sidebar_id ) {
	global $wp_registered_sidebars;

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

Related Functions

From tag: Sidebar (widgets)

No comments
    Hello, !     Log In . Register