equal
deleted
inserted
replaced
150 $this->number = $number; |
150 $this->number = $number; |
151 $this->id = $this->id_base . '-' . $number; |
151 $this->id = $this->id_base . '-' . $number; |
152 } |
152 } |
153 |
153 |
154 function _get_display_callback() { |
154 function _get_display_callback() { |
155 return array(&$this, 'display_callback'); |
155 return array($this, 'display_callback'); |
156 } |
156 } |
157 |
157 |
158 function _get_update_callback() { |
158 function _get_update_callback() { |
159 return array(&$this, 'update_callback'); |
159 return array($this, 'update_callback'); |
160 } |
160 } |
161 |
161 |
162 function _get_form_callback() { |
162 function _get_form_callback() { |
163 return array(&$this, 'form_callback'); |
163 return array($this, 'form_callback'); |
164 } |
164 } |
165 |
165 |
166 /** Generate the actual widget content. |
166 /** Generate the actual widget content. |
167 * Just finds the instance and calls widget(). |
167 * Just finds the instance and calls widget(). |
168 * Do NOT over-ride this function. */ |
168 * Do NOT over-ride this function. */ |
315 */ |
315 */ |
316 class WP_Widget_Factory { |
316 class WP_Widget_Factory { |
317 var $widgets = array(); |
317 var $widgets = array(); |
318 |
318 |
319 function WP_Widget_Factory() { |
319 function WP_Widget_Factory() { |
320 add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 ); |
320 add_action( 'widgets_init', array( $this, '_register_widgets' ), 100 ); |
321 } |
321 } |
322 |
322 |
323 function register($widget_class) { |
323 function register($widget_class) { |
324 $this->widgets[$widget_class] = new $widget_class(); |
324 $this->widgets[$widget_class] = new $widget_class(); |
325 } |
325 } |