| 1 |
<?php |
| 2 |
/** |
| 3 |
* Charitable Shortcodes Hooks. |
| 4 |
* |
| 5 |
* Action/filter hooks used for Charitable shortcodes |
| 6 |
* |
| 7 |
* @package Charitable/Functions/Shortcodes |
| 8 |
* @version 1.2.0 |
| 9 |
* @author Eric Daams |
| 10 |
* @copyright Copyright (c) 2022, Studio 164a |
| 11 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 12 |
*/ |
| 13 |
|
| 14 |
// Exit if accessed directly. |
| 15 |
if ( ! defined( 'ABSPATH' ) ) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Register shortcodes. |
| 21 |
* |
| 22 |
* @see Charitable_Campaigns_Shortcode::display() |
| 23 |
* @see Charitable_Donors_Shortcode::display() |
| 24 |
* @see Charitable_My_Donations_Shortcode::display() |
| 25 |
* @see Charitable_Donation_Form_Shortcode::display() |
| 26 |
* @see Charitable_Donation_Receipt_Shortcode::display() |
| 27 |
* @see Charitable_Login_Shortcode::display() |
| 28 |
* @see Charitable_Logout_Shortcode::display() |
| 29 |
* @see Charitable_Registration_Shortcode::display() |
| 30 |
* @see Charitable_Profile_Shortcode::display() |
| 31 |
* @see Charitable_Email_Shortcode::display() |
| 32 |
*/ |
| 33 |
add_shortcode( 'campaigns', array( 'Charitable_Campaigns_Shortcode', 'display' ) ); |
| 34 |
add_shortcode( 'charitable_donors', array( 'Charitable_Donors_Shortcode', 'display' ) ); |
| 35 |
add_shortcode( 'charitable_donation_form', array( 'Charitable_Donation_Form_Shortcode', 'display' ) ); |
| 36 |
add_shortcode( 'donation_receipt', array( 'Charitable_Donation_Receipt_Shortcode', 'display' ) ); |
| 37 |
add_shortcode( 'charitable_my_donations', array( 'Charitable_My_Donations_Shortcode', 'display' ) ); |
| 38 |
add_shortcode( 'charitable_login', array( 'Charitable_Login_Shortcode', 'display' ) ); |
| 39 |
add_shortcode( 'charitable_logout', array( 'Charitable_Logout_Shortcode', 'display' ) ); |
| 40 |
add_shortcode( 'charitable_registration', array( 'Charitable_Registration_Shortcode', 'display' ) ); |
| 41 |
add_shortcode( 'charitable_profile', array( 'Charitable_Profile_Shortcode', 'display' ) ); |
| 42 |
add_shortcode( 'charitable_stat', array( 'Charitable_Stat_Shortcode', 'display' ) ); |
| 43 |
add_shortcode( 'charitable_email', array( 'Charitable_Email_Shortcode', 'display' ) ); |
| 44 |
|
| 45 |
/** |
| 46 |
* Fingerprint the login form with our charitable=true hidden field. |
| 47 |
* |
| 48 |
* @see Charitable_Login_Shortcode::add_hidden_field_to_login_form() |
| 49 |
*/ |
| 50 |
add_filter( 'login_form_bottom', array( 'Charitable_Login_Shortcode', 'add_hidden_field_to_login_form' ), 10, 2 ); |
| 51 |
|
| 52 |
/** |
| 53 |
* Set the current email before sending or previewing an email. |
| 54 |
* |
| 55 |
* @see Charitable_Email_Shortcode::init() |
| 56 |
* @see Charitable_Email_Shortcode::init_preview() |
| 57 |
*/ |
| 58 |
add_action( 'charitable_before_send_email', array( 'Charitable_Email_Shortcode', 'init' ) ); |
| 59 |
add_action( 'charitable_before_preview_email', array( 'Charitable_Email_Shortcode', 'init_preview' ) ); |
| 60 |
|
| 61 |
/** |
| 62 |
* Flush the `Charitable_Email_Shortcode` instance after an email is sent or previewed. |
| 63 |
* |
| 64 |
* @see Charitable_Email_Shortcode::flush() |
| 65 |
*/ |
| 66 |
add_action( 'charitable_after_send_email', array( 'Charitable_Email_Shortcode', 'flush' ) ); |
| 67 |
add_action( 'charitable_after_preview_email', array( 'Charitable_Email_Shortcode', 'flush' ) ); |
| 68 |
|