wp_register_sidebar_widget ( $id, $name, $output_callback, $options = array(), $params )

  • (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:
  • 5: .
  • 5: .


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.

Related Functions

wp_unregister_sidebar_widget, register_sidebar_widget, unregister_sidebar_widget, wp_get_sidebars_widgets, wp_set_sidebars_widgets

Top Google Results

User discussions

wpseek mobile