WordPress.org

Make WordPress Core

Ticket #12400: 12400.diff

File 12400.diff, 767 bytes (added by Denis-de-Bernardy, 8 years ago)
  • wp-ajax.php

     
     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 ( !$hook || ! has_action($hook) ) {
     17        status_header(400); // invalid request
     18        exit;
     19}
     20
     21do_action($hook);
     22?>
     23 No newline at end of file