mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Dashboard fixes from mdawaffe. No longer stomps sidebar. see #5750
git-svn-id: https://develop.svn.wordpress.org/trunk@6717 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -21,9 +21,8 @@ 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 ) )
|
||||
if ( in_array( $widget['callback'], $already_shown ) ) // We already showed this multi-widget
|
||||
continue;
|
||||
$already_shown[] = $widget['callback'];
|
||||
|
||||
if ( $search_terms ) {
|
||||
$hit = false;
|
||||
@@ -52,6 +51,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
|
||||
ob_end_clean();
|
||||
|
||||
if ( !$sidebar || false !== strpos( $widget_control_template, '%i%' ) ) {
|
||||
$already_shown[] = $widget['callback']; // it's a multi-widget. We only need to show it in the list once.
|
||||
$action = 'add';
|
||||
$add_url = wp_nonce_url( add_query_arg( array(
|
||||
'sidebar' => $sidebar,
|
||||
@@ -66,7 +66,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
|
||||
'edit' => $widget['id'],
|
||||
'key' => array_search( $widget['id'], $sidebars_widgets[$sidebar] ),
|
||||
) );
|
||||
$widget_control_template = "<textarea>$widget_control_template</textarea>";
|
||||
$widget_control_template = '<textarea>' . htmlspecialchars( $widget_control_template ) . '</textarea>';
|
||||
}
|
||||
|
||||
$no_widgets_shown = false;
|
||||
|
||||
Reference in New Issue
Block a user