WP_Widget_Factory::unregister( string|WP_Widget $widget )
Un-registers a widget subclass.
Parameters
- $widget
-
(Required) Either the name of a
WP_Widget
subclass or an instance of aWP_Widget
subclass.
Source
File: wp-includes/class-wp-widget-factory.php
public function unregister( $widget ) {
if ( $widget instanceof WP_Widget ) {
unset( $this->widgets[ $this->hash_object( $widget ) ] );
} else {
unset( $this->widgets[ $widget ] );
}
}
Changelog
Version | Description |
---|---|
WP-4.6.0 | Updated the $widget parameter to also accept a WP_Widget instance object instead of simply a WP_Widget subclass name. |
WP-2.8.0 | Introduced. |