Changeset 6717 for trunk/wp-admin/widgets.php
- Timestamp:
- 02/04/2008 08:38:48 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/widgets.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/widgets.php
r6556 r6717 53 53 /* Hack #1 54 54 * The widget_control is overloaded. It updates the widget's options AND echoes out the widget's HTML form. 55 * Since we want to update before sending out any headers, we have to catch i it with an output buffer55 * Since we want to update before sending out any headers, we have to catch it with an output buffer, 56 56 */ 57 57 ob_start(); 58 58 /* There can be multiple widgets of the same type, but the widget_control for that 59 * widget type needs only be called once .59 * widget type needs only be called once if it's a multi-widget. 60 60 */ 61 61 $already_done = array(); … … 65 65 continue; 66 66 67 if ( is_callable( $control['callback'] ) ) 67 if ( is_callable( $control['callback'] ) ) { 68 68 call_user_func_array( $control['callback'], $control['params'] ); 69 $control_output = ob_get_contents(); 70 if ( false !== strpos( $control_output, '%i%' ) ) // if it's a multi-widget, only call control function once. 71 $already_done[] = $control['callback']; 72 } 73 74 ob_clean(); 69 75 } 70 76 ob_end_clean(); … … 76 82 77 83 // Reset the key numbering and stare 78 $new_sidebar = array_values( $_POST['widget-id']);84 $new_sidebar = isset( $_POST['widget-id'] ) && is_array( $_POST['widget-id'] ) ? array_values( $_POST['widget-id'] ) : array(); 79 85 $sidebars_widgets[$_POST['sidebar']] = $new_sidebar; 80 86 wp_set_sidebars_widgets( $sidebars_widgets );
Note: See TracChangeset
for help on using the changeset viewer.