On this page
wp_ajax_dashboard_widgets()
Ajax handler for dashboard widgets.
Source
File: wp-admin/includes/ajax-actions.php. View all references
function wp_ajax_dashboard_widgets() {
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
$pagenow = $_GET['pagenow'];
if ( 'dashboard-user' === $pagenow || 'dashboard-network' === $pagenow || 'dashboard' === $pagenow ) {
set_current_screen( $pagenow );
}
switch ( $_GET['widget'] ) {
case 'dashboard_primary':
wp_dashboard_primary();
break;
}
wp_die();
}
Related
Uses
| Uses | Description |
|---|---|
| set_current_screen() wp-admin/includes/screen.php | Set the current screen object |
| wp_dashboard_primary() wp-admin/includes/dashboard.php | ‘WordPress Events and News’ dashboard widget. |
| wp_die() wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_ajax_dashboard_widgets