1 <?php
2 /**
3 * Admin Actions
4 *
5 * @package EDD
6 * @subpackage Admin/Actions
7 * @copyright Copyright (c) 2013, Pippin Williamson
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.0
10 */
11
12 // Exit if accessed directly
13 if ( ! defined( 'ABSPATH' ) ) exit;
14
15 /**
16 * Processes all EDD actions sent via POST and GET by looking for the 'edd-action'
17 * request and running do_action() to call the function
18 *
19 * @since 1.0
20 * @return void
21 */
22 function edd_process_actions() {
23 if ( isset( $_POST['edd-action'] ) ) {
24 do_action( 'edd_' . $_POST['edd-action'], $_POST );
25 }
26
27 if ( isset( $_GET['edd-action'] ) ) {
28 do_action( 'edd_' . $_GET['edd-action'], $_GET );
29 }
30 }
31 add_action( 'admin_init', 'edd_process_actions' );