Changeset 7080
- Timestamp:
- 02/28/2008 12:31:46 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
wp-admin/includes/widgets.php (modified) (2 diffs)
-
wp-includes/widgets.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/widgets.php
r6980 r7080 42 42 } 43 43 44 $sidebar = is_active_widget( $widget['callback'] ); 44 $sidebar = is_active_widget( $widget['callback'], $widget['id'] ); 45 45 46 if ( ( 'unused' == $show && $sidebar ) || ( 'used' == $show && !$sidebar ) ) 46 47 continue; … … 51 52 ob_end_clean(); 52 53 53 if ( !$sidebar || false !== strpos( $widget_control_template, '%i%' ) ) { 54 $already_shown[] = $widget['callback']; // it's a multi-widget. We only need to show it in the list once. 54 if ( !$sidebar || $is_multi = false !== strpos( $widget_control_template, '%i%' ) ) { 55 if ( $is_multi ) 56 $already_shown[] = $widget['callback']; // it's a multi-widget. We only need to show it in the list once. 55 57 $action = 'add'; 56 58 $add_url = wp_nonce_url( add_query_arg( array( -
trunk/wp-includes/widgets.php
r7077 r7080 253 253 /* @return mixed false if widget is not active or id of sidebar in which the widget is active 254 254 */ 255 function is_active_widget($callback ) {255 function is_active_widget($callback, $widget_id = false) { 256 256 global $wp_registered_widgets; 257 257 … … 261 261 if ( is_array($widgets) ) foreach ( $widgets as $widget ) 262 262 if ( isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) 263 return $sidebar; 263 if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] ) 264 return $sidebar; 265 264 266 265 267 return false;
Note: See TracChangeset
for help on using the changeset viewer.