仪表板小部件的Ajax处理程序。

原型

wp_ajax_dashboard_widgets()

源文件

路径:wp-admin/includes/ajax-actions.php

<?php
...
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();
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/wp_ajax_dashboard_widgets/