wp_add_dashboard_widget

SummerySummery

Adds a new dashboard widget.

Syntax

wp_add_dashboard_widget( string $widget_id, string $widget_name, callable $callback, callable $control_callback = null, array $callback_args = null )

ParametersParameters

$widget_id

(string) (Required) Widget ID (used in the 'id' attribute for the widget).

$widget_name

(string) (Required) Title of the widget.

$callback

(callable) (Required) Function that fills the widget with the desired content. The function should echo its output.

$control_callback

(callable) (Optional) Function that outputs controls for the widget.

Default value: null

$callback_args

(array) (Optional) Data that should be set as the $args property of the widget array (which is the second parameter passed to your callback).

Default value: null

SourceSource

File: wp-admin/includes/dashboard.php


			

ChangelogChangelog

Changelog
Version Description
2.7.0 Introduced.
Scroll to Top