WP_Widget_Factory::unregister

Advertisement

Summery Summery

Un-registers a widget subclass.

Syntax Syntax

WP_Widget_Factory::unregister( string|WP_Widget $widget )

Parameters Parameters

$widget

(Required) Either the name of a WP_Widget subclass or an instance of a WP_Widget subclass.

Source Source

File: wp-includes/class-wp-widget-factory.php

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

Advertisement

Changelog Changelog

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

Advertisement

Leave a Reply