register_widget( string|WP_Widget $widget )
Register a widget
Contents
Description
Registers a WP_Widget widget
See also
Parameters
-
$widget
string|WP_Widget Required -
Either the name of a
WP_Widget
subclass or an instance of aWP_Widget
subclass.
Source
File: wp-includes/widgets.php
.
View all references
function register_widget( $widget ) {
global $wp_widget_factory;
$wp_widget_factory->register( $widget );
}
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. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example