is_dynamic_sidebar

Whether the dynamic sidebar is enabled and used by theme.

Description

is_dynamic_sidebar(); 

Usage

  1. if ( !function_exists( 'is_dynamic_sidebar' ) ) { 
  2. require_once ABSPATH . WPINC . '/widgets.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = is_dynamic_sidebar(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/widgets.php  
  1. function is_dynamic_sidebar() { 
  2. global $wp_registered_widgets, $wp_registered_sidebars; 
  3. $sidebars_widgets = get_option('sidebars_widgets'); 
  4. foreach ( (array) $wp_registered_sidebars as $index => $sidebar ) { 
  5. if ( ! empty( $sidebars_widgets[ $index ] ) ) { 
  6. foreach ( (array) $sidebars_widgets[$index] as $widget ) 
  7. if ( array_key_exists($widget, $wp_registered_widgets) ) 
  8. return true; 
  9. return false;