WordPress.org

Make WordPress Core

Ticket #4594: is_active_sidebar_api.diff

File is_active_sidebar_api.diff, 641 bytes (added by filosofo, 11 years ago)
  • wp-includes/widgets.php

     
    234234        return false;
    235235}
    236236
     237function is_active_sidebar( $index ) {
     238        $index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index);
     239        $sidebars_widgets = (array) get_option('sidebars_widgets');     
     240        if ( isset( $sidebars_widgets[$index] ) )
     241                return true;
     242        else
     243                return false;
     244}
     245
    237246function is_dynamic_sidebar() {
    238247        global $wp_registered_widgets, $wp_registered_sidebars;
    239248        $sidebars_widgets = get_option('sidebars_widgets');