wp_dashboard_trigger_widget_control()WP 2.5.0

Calls widget control callback.

No Hooks.

Return

null. Nothing (null).

Usage

wp_dashboard_trigger_widget_control( $widget_control_id );
$widget_control_id(int|false)
Registered widget ID.
Default: false

Notes

  • Global. callable[]. $wp_dashboard_control_callbacks

Changelog

Since 2.5.0 Introduced.

wp_dashboard_trigger_widget_control() code WP 6.6.2

function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
	global $wp_dashboard_control_callbacks;

	if ( is_scalar( $widget_control_id ) && $widget_control_id
		&& isset( $wp_dashboard_control_callbacks[ $widget_control_id ] )
		&& is_callable( $wp_dashboard_control_callbacks[ $widget_control_id ] )
	) {
		call_user_func(
			$wp_dashboard_control_callbacks[ $widget_control_id ],
			'',
			array(
				'id'       => $widget_control_id,
				'callback' => $wp_dashboard_control_callbacks[ $widget_control_id ],
			)
		);
	}
}