1 <?php
2 /**
3 * Front-end Actions
4 *
5 * @package EDD
6 * @subpackage Functions
7 * @copyright Copyright (c) 2013, Pippin Williamson
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.0.8.1
10 */
11
12 // Exit if accessed directly
13 if ( !defined( 'ABSPATH' ) ) exit;
14
15 /**
16 * Hooks EDD actions, when present in the $_GET superglobal. Every edd_aciton
17 * present in $_GET is called using WordPress's do_action function. These
18 * functions are called on init.
19 *
20 * @since 1.0
21 * @return void
22 */
23 function edd_get_actions() {
24 if ( isset( $_GET['edd_action'] ) ) {
25 do_action( 'edd_' . $_GET['edd_action'], $_GET );
26 }
27 }
28 add_action( 'init', 'edd_get_actions' );
29
30 /**
31 * Hooks EDD actions, when present in the $_POST superglobal. Every edd_aciton
32 * present in $_POST is called using WordPress's do_action function. These
33 * functions are called on init.
34 *
35 * @since 1.0
36 * @return void
37 */
38 function edd_post_actions() {
39 if ( isset( $_POST['edd_action'] ) ) {
40 do_action( 'edd_' . $_POST['edd_action'], $_POST );
41 }
42 }
43 add_action( 'init', 'edd_post_actions' );