A WordPress-centric search engine for devs and theme authors



wp_ajax_dashboard_widgets ›

Since3.4.0
Deprecatedn/a
wp_ajax_dashboard_widgets ( No parameters )
Defined at:
Codex:

Ajax handler for dashboard widgets.



Source

function wp_ajax_dashboard_widgets() {
	require_once ABSPATH . 'wp-admin/includes/dashboard.php';

	$pagenow = $_GET['pagenow'];
	if ( $pagenow === 'dashboard-user' || $pagenow === 'dashboard-network' || $pagenow === 'dashboard' ) {
		set_current_screen( $pagenow );
	}

	switch ( $_GET['widget'] ) {
		case 'dashboard_primary':
			wp_dashboard_primary();
			break;
	}
	wp_die();
}