wp_add_dashboard_widget ( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null, $context = 'normal', $priority = 'core' )

  • (string) widget_id Widget ID (used in the 'id' attribute for the widget).
  • (string) widget_name Title of the widget.
  • (callable) callback Function that fills the widget with the desired content. The function should echo its output.
  • (callable) control_callback Optional. Function that outputs controls for the widget. Default null.
  • (array) callback_args Optional. Data that should be set as the $args property of the widget array (which is the second parameter passed to your callback). Default null.
  • (string) context Optional. The context within the screen where the box should display. Accepts 'normal', 'side', 'column3', or 'column4'. Default 'normal'.
  • (string) priority Optional. The priority within the context where the box should show. Accepts 'high', 'core', 'default', or 'low'. Default 'core'.
Defined at:
Change Log:
  • 5: .


Adds a new dashboard widget.

Related Functions

wp_ajax_dashboard_widgets, add_dashboard_page, wp_dashboard_setup, wp_dashboard_empty, wp_dashboard_cached_rss_widget

Top Google Results

User discussions

wpseek mobile