Uses
| Uses | Description |
|---|---|
| wp-includes/class-wp-widget-factory.php: WP_Widget_Factory::register() | Registers a widget subclass. |
Register a widget
Registers a WP_Widget widget
(string|WP_Widget) (Required) Either the name of a WP_Widget subclass or an instance of a WP_Widget subclass.
File: wp-includes/widgets.php
function register_widget( $widget ) {
global $wp_widget_factory;
$wp_widget_factory->register( $widget );
} | 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. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/register_widget