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