svn:eol-style:native props Denis-de-Bernardy
git-svn-id: http://svn.automattic.com/wordpress/trunk@13530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
90637984b6
commit
bc84ed40cb
58
wp-ajax.php
58
wp-ajax.php
|
@ -1,30 +1,30 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Execute an AJAX action.
|
* Execute an AJAX action.
|
||||||
*
|
*
|
||||||
* To take full advantage of this file, call wp_ajaxurl(); in your theme
|
* 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
|
* or plugin while registering your front-end scripts. Doing so will make
|
||||||
* an ajaxurl variable available for use in javascripts. The ajaxurl
|
* an ajaxurl variable available for use in javascripts. The ajaxurl
|
||||||
* variable will point to this file's absolute URL.
|
* variable will point to this file's absolute URL.
|
||||||
*
|
*
|
||||||
* In the admin area, an ajaxurl variable is always available, and points
|
* In the admin area, an ajaxurl variable is always available, and points
|
||||||
* to wp-admin/admin-ajax.php instead.
|
* to wp-admin/admin-ajax.php instead.
|
||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
define('DOING_AJAX', true);
|
define('DOING_AJAX', true);
|
||||||
require_once('wp-load.php');
|
require_once('wp-load.php');
|
||||||
|
|
||||||
@header('Content-Type: text/html; charset=' . get_option('blog_charset'));
|
@header('Content-Type: text/html; charset=' . get_option('blog_charset'));
|
||||||
|
|
||||||
do_action('ajax_init');
|
do_action('ajax_init');
|
||||||
|
|
||||||
$hook = !empty($_REQUEST['action']) ? 'ajax_' . $_REQUEST['action'] : false;
|
$hook = !empty($_REQUEST['action']) ? 'ajax_' . $_REQUEST['action'] : false;
|
||||||
|
|
||||||
if ( empty($hook) || ! has_action($hook) ) {
|
if ( empty($hook) || ! has_action($hook) ) {
|
||||||
status_header(400);
|
status_header(400);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action($hook);
|
do_action($hook);
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue