Make WordPress Core

Changeset 19739


Ignore:
Timestamp:
01/23/2012 07:31:15 PM (13 years ago)
Author:
nacin
Message:

Strip down admin-ajax.php to be a bare ajax handler. Move core ajax handlers to admin/includes/ajax-actions.php. props kurtpayne, ryan. see #15327. see [19738] for initial commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r19738 r19739  
    55 * @package WordPress
    66 * @subpackage Administration
     7 *
     8 * @link http://codex.wordpress.org/AJAX_in_Plugins
    79 */
    810
     
    1921    die( '-1' );
    2022
    21 // Load libraries
    22 require_once('../wp-load.php');
    23 require_once('./includes/admin.php');
    24 require_once('./includes/ajax-actions.php');
     23/** Load WordPress Bootstrap */
     24require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
     25
     26/** Load WordPress Administration APIs */
     27require_once( ABSPATH . 'wp-admin/includes/admin.php' );
     28
     29/** Load Ajax Handlers for WordPress Core */
     30require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
    2531
    2632@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
     
    4349);
    4450
     51// Register core Ajax calls.
    4552if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) )
    4653    add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );
Note: See TracChangeset for help on using the changeset viewer.