mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 18:32:23 +01:00
Remove wp-ajax.php. admin-ajax.php can be used (and is better for) for front-end/nopriv AJAX requests. fixes #12400
git-svn-id: http://svn.automattic.com/wordpress/trunk@13828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a7feaed0e6
commit
fdca5f9029
31
wp-ajax.php
31
wp-ajax.php
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Execute an AJAX action.
|
||||
*
|
||||
* To take full advantage of this file, call wp_ajaxurl(); in your theme
|
||||
* or plugin while registering your front-end scripts. Doing so will make
|
||||
* an ajaxurl variable available for use in javascripts. The ajaxurl
|
||||
* variable will point to this file's absolute URL.
|
||||
*
|
||||
* In the admin area, an ajaxurl variable is always available, and points
|
||||
* to wp-admin/admin-ajax.php instead.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
define('DOING_AJAX', true);
|
||||
require_once('wp-load.php');
|
||||
|
||||
@header('Content-Type: text/html; charset=' . get_option('blog_charset'));
|
||||
send_nosniff_header();
|
||||
|
||||
do_action('ajax_init');
|
||||
|
||||
$hook = !empty($_REQUEST['action']) ? 'ajax_' . $_REQUEST['action'] : false;
|
||||
|
||||
if ( empty($hook) || ! has_action($hook) ) {
|
||||
status_header(400);
|
||||
exit;
|
||||
}
|
||||
|
||||
do_action($hook);
|
||||
?>
|
Loading…
Reference in New Issue
Block a user