diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index bd425f9262..da8b822777 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -21,7 +21,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) { $no_widgets_shown = true; $already_shown = array(); foreach ( $wp_registered_widgets as $name => $widget ) : - if ( in_array( $widget['callback'], $already_shown ) ) // We already showed this multi-widget + if ( 'all' == $show && in_array( $widget['callback'], $already_shown ) ) // We already showed this multi-widget continue; if ( $search_terms ) { @@ -47,7 +47,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) { continue; ob_start(); - $args = wp_list_widget_controls_dynamic_sidebar( array( 0 => array( 'widget_id' => $widget['id'], 'widget_name' => $widget['name'], '_display' => 'template' ) ) ); + $args = wp_list_widget_controls_dynamic_sidebar( array( 0 => array( 'widget_id' => $widget['id'], 'widget_name' => $widget['name'], '_display' => 'template', '_show' => $show ), 1 => $widget['params'][0] ) ); $sidebar_args = call_user_func_array( 'wp_widget_control', $args ); $widget_control_template = ob_get_contents(); ob_end_clean(); @@ -61,7 +61,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) { 'key' => false, 'edit' => false ); - if ( $is_multi ) { + if ( 'all' == $show && $is_multi ) { // it's a multi-widget. We only need to show it in the list once. $already_shown[] = $widget['callback']; $num = (int) array_pop( explode( '-', $widget['id'] ) ); @@ -92,12 +92,17 @@ function wp_list_widgets( $show = 'all', $_search = false ) { $no_widgets_shown = false; + + if ( 'all' != $show && $sidebar_args['_widget_title'] ) + $widget_title = $sidebar_args['_widget_title']; + else + $widget_title = $widget['name']; ?>