function is_active_sidebar( $index ) {}

Whether a sidebar is in use.


  • mixed $index: Sidebar name, id or number to check.

Return values

returns:true if the sidebar is in use, false otherwise.

Source code

function is_active_sidebar( $index ) {

	$index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index);

	$sidebars_widgets = wp_get_sidebars_widgets();

	if ( !empty($sidebars_widgets[$index]) )

		return true;

	return false;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: