Registers a widget subclass.
Parameters
$widget
string|WP_Widgetrequired- Either the name of a
WP_Widget
subclass or an instance of aWP_Widget
subclass.
Source
public function register( $widget ) {
if ( $widget instanceof WP_Widget ) {
$this->widgets[ spl_object_hash( $widget ) ] = $widget;
} else {
$this->widgets[ $widget ] = new $widget();
}
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.