wp_register_sidebar_widget
wp_register_sidebar_widget ( $id, $name, $output_callback, $options = array(), $params )
Parameters:- (int|string) id Widget ID.
- (string) name Widget display title.
- (callable) output_callback Run when widget is called.
- (array) options { Optional. An array of supplementary widget options for the instance. @type string $classname Class name for the widget's HTML container. Default is a shortened version of the output callback name. @type string $description Widget description for display in the widget administration panel and/or theme. @type bool $show_instance_in_rest Whether to show the widget's instance settings in the REST API. Only available for WP_Widget based widgets. }
- (mixed) params Optional additional parameters to pass to the callback function when it's called.
Defined at:Change Log: - Introduced in WordPress: 2.2.0
- Deprecated in WordPress: —
Description
Register an instance of a widget.The default widget option is 'classname' that can be overridden.
The function can also be used to un-register widgets when `$output_callback`
parameter is an empty string.