Uma área de pesquisa sobre o WordPress para devs e autores do tema



is_dynamic_sidebar ›

Desde2.2.0
Obsoleton/a
is_dynamic_sidebar ( Sem parâmetros )
Retorna:
  • (bool) True, if using widgets. False, if not using widgets.
Definido em:
Codex:

Whether the dynamic sidebar is enabled and used by theme.



Fonte

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 ( ! empty( $sidebars_widgets[ $index ] ) ) {
			foreach ( (array) $sidebars_widgets[$index] as $widget )
				if ( array_key_exists($widget, $wp_registered_widgets) )
					return true;
		}
	}
	return false;
}