| 1 | --- wp-includes/widgets-2.8.1.php 2009-07-10 15:12:26.000000000 +0200 |
|---|
| 2 | +++ wp-includes/widgets.php 2009-07-18 16:08:56.000000000 +0200 |
|---|
| 3 | @@ -933,9 +933,20 @@ |
|---|
| 4 | * @param mixed $index, sidebar name, id or number to check. |
|---|
| 5 | * @return bool true if the sidebar is in use, false otherwise. |
|---|
| 6 | */ |
|---|
| 7 | function is_active_sidebar( $index ) { |
|---|
| 8 | - $index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index); |
|---|
| 9 | + global $wp_registered_sidebars; |
|---|
| 10 | + if ( is_int($index) ) { |
|---|
| 11 | + $index = "sidebar-$index"; |
|---|
| 12 | + } else { |
|---|
| 13 | + $index = sanitize_title($index); |
|---|
| 14 | + foreach ( (array) $wp_registered_sidebars as $key => $value ) { |
|---|
| 15 | + if ( sanitize_title($value['name']) == $index ) { |
|---|
| 16 | + $index = $key; |
|---|
| 17 | + break; |
|---|
| 18 | + } |
|---|
| 19 | + } |
|---|
| 20 | + } |
|---|
| 21 | $sidebars_widgets = wp_get_sidebars_widgets(); |
|---|
| 22 | if ( isset($sidebars_widgets[$index]) && !empty($sidebars_widgets[$index]) ) |
|---|
| 23 | return true; |
|---|
| 24 | |
|---|