WordPress.org

Make WordPress Core

Ticket #12400: wp-ajax.php

File wp-ajax.php, 541 bytes (added by dd32, 4 years ago)

Replacing old file with new without debug + corrected comments

Line 
1<?php
2/**
3 * Execute an AJAX action.
4 *
5 * @since 3.0
6 */
7define('DOING_AJAX', true);
8require_once('wp-load.php');
9
10@header('Content-Type: text/html; charset=' . get_option('blog_charset'));
11
12do_action('ajax_init');
13
14$hook = !empty($_REQUEST['action']) ? 'ajax_' . stripslashes($_REQUEST['action']) : false;
15
16if ( empty($hook) || ! has_action($hook) ) {
17        status_header(404);
18        exit;
19}
20
21// Perform the Ajax action. Note: UNSLASHED data is passed in the first parameter.
22do_action($hook, stripslashes_deep($_REQUEST) );
23?>