wp_dashboard_trigger_widget_control() WordPress Function

The wp_dashboard_trigger_widget_control() function is used to trigger the display of a widget control for a particular widget on the WordPress Dashboard. This function is used internally by WordPress.

wp_dashboard_trigger_widget_control( int|false $widget_control_id = false ) #

Calls widget control callback.


Parameters

$widget_control_id

(int|false)(Optional) Registered widget ID.

Default value: false


Top ↑

Source

File: wp-admin/includes/dashboard.php

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 ],
			)
		);
	}
}


Top ↑

Changelog

Changelog
VersionDescription
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.