11 /** We are located in WordPress Administration Screens */ |
11 /** We are located in WordPress Administration Screens */ |
12 if ( ! defined( 'WP_ADMIN' ) ) { |
12 if ( ! defined( 'WP_ADMIN' ) ) { |
13 define( 'WP_ADMIN', true ); |
13 define( 'WP_ADMIN', true ); |
14 } |
14 } |
15 |
15 |
16 if ( defined('ABSPATH') ) |
16 if ( defined( 'ABSPATH' ) ) { |
17 require_once(ABSPATH . 'wp-load.php'); |
17 require_once( ABSPATH . 'wp-load.php' ); |
18 else |
18 } else { |
19 require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); |
19 require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); |
|
20 } |
20 |
21 |
21 /** Allow for cross-domain requests (from the front end). */ |
22 /** Allow for cross-domain requests (from the front end). */ |
22 send_origin_headers(); |
23 send_origin_headers(); |
23 |
24 |
24 require_once(ABSPATH . 'wp-admin/includes/admin.php'); |
25 require_once( ABSPATH . 'wp-admin/includes/admin.php' ); |
25 |
26 |
26 nocache_headers(); |
27 nocache_headers(); |
27 |
28 |
28 /** This action is documented in wp-admin/admin.php */ |
29 /** This action is documented in wp-admin/admin.php */ |
29 do_action( 'admin_init' ); |
30 do_action( 'admin_init' ); |
30 |
31 |
31 $action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action']; |
32 $action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action']; |
32 |
33 |
33 if ( ! wp_validate_auth_cookie() ) { |
34 if ( ! is_user_logged_in() ) { |
34 if ( empty( $action ) ) { |
35 if ( empty( $action ) ) { |
35 /** |
36 /** |
36 * Fires on a non-authenticated admin post request where no action was supplied. |
37 * Fires on a non-authenticated admin post request where no action is supplied. |
37 * |
38 * |
38 * @since 2.6.0 |
39 * @since 2.6.0 |
39 */ |
40 */ |
40 do_action( 'admin_post_nopriv' ); |
41 do_action( 'admin_post_nopriv' ); |
41 } else { |
42 } else { |