Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/wp-admin/includes/ajax-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,19 @@ function wp_ajax_get_community_events() {
function wp_ajax_dashboard_widgets() {
require_once ABSPATH . 'wp-admin/includes/dashboard.php';

$pagenow = $_GET['pagenow'];
$pagenow = isset( $_GET['pagenow'] )
? sanitize_key( wp_unslash( $_GET['pagenow'] ) )
: '';

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

switch ( $_GET['widget'] ) {
$widget = isset( $_GET['widget'] )
? sanitize_key( wp_unslash( $_GET['widget'] ) )
: '';

switch ( $widget ) {
case 'dashboard_primary':
wp_dashboard_primary();
break;
Expand Down
Loading