Changeset 10979
- Timestamp:
- 04/17/2009 05:54:07 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r10912 r10979 294 294 } 295 295 296 function unregister($widget_class) { 297 $offset = array_search($widget_class, $this->widgets); 298 if ( false === $offset ) 299 return; 300 301 array_splice($this->widgets, $offset, 1); 302 } 303 296 304 function _register_widgets() { 297 305 foreach ( $this->widgets as $widget ) … … 349 357 350 358 $wp_widget_factory->register($widget_class); 359 } 360 361 /** 362 * Unregister a widget 363 * 364 * Unregisters a WP_Widget widget. Useful for unregistering default widgets. 365 * Run within a function hooked to the widgets_init action. 366 * 367 * @since 2.8.0 368 * 369 * @see WP_Widget 370 * @see WP_Widget_Factory 371 * @uses WP_Widget_Factory 372 * 373 * @param string $widget_class The name of a class that extends WP_Widget 374 */ 375 function unregister_widget($widget_class) { 376 global $wp_widget_factory; 377 378 $wp_widget_factory->unregister($widget_class); 351 379 } 352 380
Note: See TracChangeset
for help on using the changeset viewer.