From b2a796245a5546b34fd3e742f79be7c4f9dd2b99 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 28 Apr 2008 20:08:23 +0000 Subject: [PATCH] Multi-widget pattern documentation typo fixes from Jaymin Patel. fixes #6866 git-svn-id: https://develop.svn.wordpress.org/trunk@7849 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/widgets.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 9fa26306f8..605b0b913e 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -306,9 +306,9 @@ function wp_get_sidebars_widgets($update = true) { $_sidebars_widgets[$index][$i] = $id; continue; } - + $found = false; - + foreach ( $wp_registered_widgets as $widget_id => $widget ) { if ( strtolower($widget['name']) == strtolower($name) ) { $_sidebars_widgets[$index][$i] = $widget['id']; @@ -320,10 +320,10 @@ function wp_get_sidebars_widgets($update = true) { break; } } - + if ( $found ) continue; - + unset($_sidebars_widgets[$index][$i]); } $_sidebars_widgets['array_version'] = 2; @@ -1496,7 +1496,7 @@ function widget_many_control( $widget_args = 1 ) { $options[$widget_number] = array( 'something' => $something ); // Even simple widgets should store stuff in array, rather than in scalar } - update_option('widget_text', $options); + update_option('widget_many', $options); $updated = true; // So that we don't go through this more than once } @@ -1538,8 +1538,8 @@ function widget_many_register() { // $id should look like {$id_base}-{$o} $id = "many-$o"; // Never never never translate an id $registered = true; - wp_register_sidebar_widget( $id, $name, 'wp_widget_text', $widget_ops, array( 'number' => $o ) ); - wp_register_widget_control( $id, $name, 'wp_widget_text_control', $control_ops, array( 'number' => $o ) ); + wp_register_sidebar_widget( $id, $name, 'widget_many', $widget_ops, array( 'number' => $o ) ); + wp_register_widget_control( $id, $name, 'widget_many_control', $control_ops, array( 'number' => $o ) ); } // If there are none, we register the widget's existance with a generic template