WP_Widget_Factory::unregister
Un-registers a widget subclass.
Метод класса: WP_Widget_Factory{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WP_Widget_Factory = new WP_Widget_Factory(); $WP_Widget_Factory->unregister( $widget );
- $widget(строка|WP_Widget) (обязательный)
- Either the name of a
WP_Widgetsubclass or an instance of aWP_Widgetsubclass.
Список изменений
| С версии 2.8.0 | Введена. |
| С версии 4.6.0 | Updated the $widget parameter to also accept a WP_Widget instance object instead of simply a WP_Widget subclass name. |
Код WP_Widget_Factory::unregister() WP Widget Factory::unregister WP 6.9.1
public function unregister( $widget ) {
if ( $widget instanceof WP_Widget ) {
unset( $this->widgets[ spl_object_hash( $widget ) ] );
} else {
unset( $this->widgets[ $widget ] );
}
}