2008-07-11 22:24:35 +02:00
|
|
|
<?php
|
2008-08-11 22:26:31 +02:00
|
|
|
/**
|
2013-09-22 07:18:09 +02:00
|
|
|
* WordPress Generic Request (POST/GET) Handler
|
|
|
|
*
|
|
|
|
* Intended for form submission handling in themes and plugins.
|
2008-08-11 22:26:31 +02:00
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Administration
|
|
|
|
*/
|
|
|
|
|
2011-04-28 17:24:49 +02:00
|
|
|
/** We are located in WordPress Administration Screens */
|
2008-08-11 22:26:31 +02:00
|
|
|
define('WP_ADMIN', true);
|
2008-07-11 22:24:35 +02:00
|
|
|
|
|
|
|
if ( defined('ABSPATH') )
|
|
|
|
require_once(ABSPATH . 'wp-load.php');
|
|
|
|
else
|
2013-09-25 02:18:11 +02:00
|
|
|
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
|
2008-07-11 22:24:35 +02:00
|
|
|
|
2013-08-16 21:59:08 +02:00
|
|
|
/** Allow for cross-domain requests (from the frontend). */
|
|
|
|
send_origin_headers();
|
|
|
|
|
2008-07-11 22:24:35 +02:00
|
|
|
require_once(ABSPATH . 'wp-admin/includes/admin.php');
|
|
|
|
|
|
|
|
nocache_headers();
|
|
|
|
|
2013-10-25 00:59:20 +02:00
|
|
|
/** This action is documented in wp-admin/admin.php */
|
2013-09-24 01:48:09 +02:00
|
|
|
do_action( 'admin_init' );
|
2008-07-11 22:24:35 +02:00
|
|
|
|
2014-05-08 13:00:15 +02:00
|
|
|
$action = '';
|
2014-05-08 12:47:15 +02:00
|
|
|
|
|
|
|
if ( !wp_validate_auth_cookie() )
|
|
|
|
$action .= '_nopriv';
|
|
|
|
|
|
|
|
if ( !empty($_REQUEST['action']) )
|
|
|
|
$action .= '_' . $_REQUEST['action'];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fires the requested handler action.
|
|
|
|
*
|
2014-05-08 13:00:15 +02:00
|
|
|
* The dynamic portion of the hook name, $action, refers to a combination
|
|
|
|
* of whether the user is logged-in or not, and the requested handler action.
|
|
|
|
*
|
|
|
|
* If the user is logged-out, '_nopriv' will be affixed to the
|
|
|
|
* base "admin_post" hook name. If a handler action was passed, that action
|
|
|
|
* will also be affixed.
|
|
|
|
*
|
|
|
|
* For example:
|
|
|
|
* Hook combinations fired for logged-out users:
|
|
|
|
* `admin_post_nopriv_{$action}` and `admin_post_nopriv` (no action supplied).
|
|
|
|
*
|
|
|
|
* Hook combinations fired for logged-in users:
|
|
|
|
* `admin_post_{$action}` and `admin_post` (no action supplied).
|
2014-05-08 12:47:15 +02:00
|
|
|
*
|
|
|
|
* @since 2.6.0
|
|
|
|
*/
|
2014-05-08 13:00:15 +02:00
|
|
|
do_action( "admin_post{$action}" );
|