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 if ( ! defined( 'WP_ADMIN' ) ) {
13 define( 'WP_ADMIN', true );
16 if ( defined('ABSPATH') )
17 require_once(ABSPATH . 'wp-load.php');
19 require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
21 /** Allow for cross-domain requests (from the front end). */
22 send_origin_headers();
24 require_once(ABSPATH . 'wp-admin/includes/admin.php');
28 /** This action is documented in wp-admin/admin.php */
29 do_action( 'admin_init' );
31 $action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action'];
33 if ( ! wp_validate_auth_cookie() ) {
34 if ( empty( $action ) ) {
36 * Fires on a non-authenticated admin post request where no action was supplied.
40 do_action( 'admin_post_nopriv' );
43 * Fires on a non-authenticated admin post request for the given action.
45 * The dynamic portion of the hook name, `$action`, refers to the given
50 do_action( "admin_post_nopriv_{$action}" );
53 if ( empty( $action ) ) {
55 * Fires on an authenticated admin post request where no action was supplied.
59 do_action( 'admin_post' );
62 * Fires on an authenticated admin post request for the given action.
64 * The dynamic portion of the hook name, `$action`, refers to the given
69 do_action( "admin_post_{$action}" );