WordPress at a glance
function is not described

WP_Widget_Factory::unregister() public WP 2.8.0

Un-registers a widget subclass.

{} It's a method of the class: WP_Widget_Factory{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Widget_Factory = new WP_Widget_Factory();
$WP_Widget_Factory->unregister( $widget );
$widget(string|WP_Widget) (required)
Either the name of a WP_Widget subclass or an instance of a WP_Widget subclass.

Changelog

Since 2.8.0 Introduced.
Since 4.6.0 Updated the $widget parameter to also accept a WP_Widget instance object instead of simply a WP_Widget subclass name.

Code of WP_Widget_Factory::unregister() WP 5.7.2

<?php
public function unregister( $widget ) {
	if ( $widget instanceof WP_Widget ) {
		unset( $this->widgets[ spl_object_hash( $widget ) ] );
	} else {
		unset( $this->widgets[ $widget ] );
	}
}