Changeset 11009 for trunk/wp-includes/widgets.php
- Timestamp:
- 04/20/2009 10:58:50 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/widgets.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r10991 r11009 24 24 class WP_Widget { 25 25 26 var $id_base; // Root id for all widgets of this type.26 var $id_base; // Root id for all widgets of this type. 27 27 var $name; // Name for this widget type. 28 28 var $widget_options; // Option array passed to wp_register_sidebar_widget() … … 62 62 /** Echo the settings update form 63 63 * 64 * @param array $instance Current settings 64 * @param array $instance Current settings 65 65 */ 66 66 function form($instance) { 67 67 echo '<p>' . __('There are no options for this widget.') . '</p>'; 68 return false; 68 69 } 69 70 … … 88 89 function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) { 89 90 $this->id_base = $id_base; 91 // $this->id_base = str_replace( 'wp_widget_', '', strtolower(get_class($this)) ); 90 92 $this->name = $name; 91 93 $this->option_name = 'widget_' . $id_base; 92 94 $this->widget_options = wp_parse_args( $widget_options, array('classname' => $this->option_name) ); 93 95 $this->control_options = wp_parse_args( $control_options, array('id_base' => $this->id_base) ); 94 95 //add_action( 'widgets_init', array( &$this, '_register' ) );96 96 } 97 97 … … 208 208 } 209 209 } else { 210 foreach ( (array) $_POST['widget-' . $this->id_base] as $number => $new_instance ) { 210 if ( isset($_POST['widget-' . $this->id_base]) && is_array($_POST['widget-' . $this->id_base]) ) { 211 $settings = $_POST['widget-' . $this->id_base]; 212 } else { 213 $num = $_POST['multi_number'] ? (int) $_POST['multi_number'] : (int) $_POST['widget_number']; 214 $settings = array( $num => array() ); 215 } 216 217 foreach ( $settings as $number => $new_instance ) { 211 218 $new_instance = stripslashes_deep($new_instance); 212 219 $this->_set($number); … … 245 252 } 246 253 247 $this->form($instance);254 return $this->form($instance); 248 255 } 249 256
Note: See TracChangeset
for help on using the changeset viewer.