forked from impress-org/givewp
/
actions.php
47 lines (42 loc) · 1.08 KB
/
actions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Front-end Actions
*
* @package Give
* @subpackage Functions
* @copyright Copyright (c) 2015, WordImpress
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Hooks Give actions, when present in the $_GET superglobal. Every give_action
* present in $_GET is called using WordPress's do_action function. These
* functions are called on init.
*
* @since 1.0
* @return void
*/
function give_get_actions() {
if ( isset( $_GET['give_action'] ) ) {
do_action( 'give_' . $_GET['give_action'], $_GET );
}
}
add_action( 'init', 'give_get_actions' );
/**
* Hooks Give actions, when present in the $_POST superglobal. Every give_action
* present in $_POST is called using WordPress's do_action function. These
* functions are called on init.
*
* @since 1.0
* @return void
*/
function give_post_actions() {
if ( isset( $_POST['give_action'] ) ) {
do_action( 'give_' . $_POST['give_action'], $_POST );
}
}
add_action( 'init', 'give_post_actions' );