Advertisements

is_active_sidebar

Definition:
function is_active_sidebar( $index ) {}

Whether a sidebar is in use.

Parameters

  • 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;

}

2081

Advertisements

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:

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: