1 | <?php |
---|
2 | /** |
---|
3 | * Execute an AJAX action. |
---|
4 | * |
---|
5 | * @since 3.0 |
---|
6 | */ |
---|
7 | define('DOING_AJAX', true); |
---|
8 | require_once('wp-load.php'); |
---|
9 | |
---|
10 | @header('Content-Type: text/html; charset=' . get_option('blog_charset')); |
---|
11 | |
---|
12 | do_action('ajax_init'); |
---|
13 | |
---|
14 | $hook = !empty($_REQUEST['action']) ? 'ajax_' . stripslashes($_REQUEST['action']) : false; |
---|
15 | |
---|
16 | if ( 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. |
---|
22 | do_action($hook, stripslashes_deep($_REQUEST) ); |
---|
23 | ?> |
---|