3 * WordPress Generic Request (POST/GET) Handler
5 * Intended for form submission handling in themes and plugins.
8 * @subpackage Administration
11 /** We are located in WordPress Administration Screens */
12 define('WP_ADMIN', true);
14 if ( defined('ABSPATH') )
15 require_once(ABSPATH . 'wp-load.php');
17 require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
19 /** Allow for cross-domain requests (from the frontend). */
20 send_origin_headers();
22 require_once(ABSPATH . 'wp-admin/includes/admin.php');
26 /** This action is documented in wp-admin/admin.php */
27 do_action( 'admin_init' );
29 $action = 'admin_post';
31 if ( !wp_validate_auth_cookie() )
34 if ( !empty($_REQUEST['action']) )
35 $action .= '_' . $_REQUEST['action'];
38 * Fires the requested handler action.
40 * admin_post_nopriv_{$_REQUEST['action']} is called for not-logged-in users.
41 * admin_post_{$_REQUEST['action']} is called for logged-in users.