Skip to content

Commit

Permalink
Remove index-extra.php. Move dashboard widget XHR callbacks to ajax-a…
Browse files Browse the repository at this point in the history
…ctions.php. fixes #20242.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Mar 15, 2012
1 parent ae6bf5b commit 1db1017
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 65 deletions.
5 changes: 4 additions & 1 deletion wp-admin/admin-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@

do_action( 'admin_init' );

$core_actions_get = array( 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', 'autocomplete-user' );
$core_actions_get = array(
'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache',
'autocomplete-user', 'dashboard-widgets',
);

$core_actions_post = array(
'oembed-cache', 'image-editor', 'delete-comment', 'delete-tag', 'delete-link',
Expand Down
20 changes: 20 additions & 0 deletions wp-admin/includes/ajax-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,26 @@ function wp_ajax_autocomplete_user() {
wp_die( json_encode( $return ) );
}

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

switch ( $_GET['widget'] ) {
case 'dashboard_incoming_links' :
wp_dashboard_incoming_links();
break;
case 'dashboard_primary' :
wp_dashboard_primary();
break;
case 'dashboard_secondary' :
wp_dashboard_secondary();
break;
case 'dashboard_plugins' :
wp_dashboard_plugins();
break;
}
wp_die();
}

/*
* Ajax helper.
*/
Expand Down
3 changes: 3 additions & 0 deletions wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@
'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif',
// 3.4
'wp-admin/images/logo-login.png',
'wp-admin/index-extra.php',
'wp-admin/network/index-extra.php',
'wp-admin/user/index-extra.php',
);

/**
Expand Down
38 changes: 0 additions & 38 deletions wp-admin/index-extra.php

This file was deleted.

2 changes: 1 addition & 1 deletion wp-admin/js/dashboard.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jQuery(document).ready( function($) {
if ( e.length ) {
p = e.parent();
setTimeout( function(){
p.load( ajaxurl.replace( '/admin-ajax.php', '' ) + '/index-extra.php?jax=' + id, '', function() {
p.load( ajaxurl + '?action=dashboard-widgets&widget=' + id, '', function() {
p.hide().slideDown('normal', function(){
$(this).css('display', '');
});
Expand Down
13 changes: 0 additions & 13 deletions wp-admin/network/index-extra.php

This file was deleted.

12 changes: 0 additions & 12 deletions wp-admin/user/index-extra.php

This file was deleted.

0 comments on commit 1db1017

Please sign in to comment.