Advertisements

is_dynamic_sidebar

Definition:
function is_dynamic_sidebar() {}

Whether the dynamic sidebar is enabled and used by theme.

Return values

returns:True, if using widgets. False, if not using widgets.

Source code

function is_dynamic_sidebar() {

	global $wp_registered_widgets, $wp_registered_sidebars;

	$sidebars_widgets = get_option('sidebars_widgets');

	foreach ( (array) $wp_registered_sidebars as $index => $sidebar ) {

		if ( count($sidebars_widgets[$index]) ) {

			foreach ( (array) $sidebars_widgets[$index] as $widget )

				if ( array_key_exists($widget, $wp_registered_widgets) )

					return true;

		}

	}

	return false;

}

2113

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: