WordPress.org

Make WordPress Core

Ticket #9209: wp-ajax.patch

File wp-ajax.patch, 672 bytes (added by DanCoulter, 13 years ago)
  • wp-ajax.php

     
     1<?php
     2/**
     3 * WordPress AJAX Process Execution (for public pages).
     4 *
     5 * @package WordPress
     6 */
     7
     8/**
     9 * Executing AJAX process.
     10 *
     11 * @since unknown
     12 */
     13define('DOING_AJAX', true);
     14
     15require( dirname(__FILE__) . '/wp-load.php' );
     16
     17if ( isset( $_GET['action'] ) ) :
     18        do_action( 'wp_ajax_public_' . $_GET['action'] );
     19        die('0');
     20        break;
     21elseif ( isset( $_POST['action'] ) ) :
     22        do_action( 'wp_ajax_public_' . $_POST['action'] );
     23        die('0');
     24        break;
     25endif;
     26?>