| 1 |
<?php |
| 2 |
/** |
| 3 |
* Charitable Tracking Hooks. |
| 4 |
* |
| 5 |
* Action/filter hooks used for Charitable Tracking. |
| 6 |
* |
| 7 |
* @package Charitable/Functions/Admin |
| 8 |
* @author David Bisset |
| 9 |
* @copyright Copyright (c) 2023, WP Charitable LLC |
| 10 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 11 |
* @since 1.8.4 |
| 12 |
*/ |
| 13 |
|
| 14 |
// Exit if accessed directly. |
| 15 |
if ( ! defined( 'ABSPATH' ) ) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Cron stuff. |
| 21 |
* |
| 22 |
* @see Charitable_Tracking::schedule_send() |
| 23 |
* @see Charitable_Tracking::add_schedules() |
| 24 |
*/ |
| 25 |
add_action( 'init', array( Charitable_Tracking::get_instance(), 'schedule_send' ) ); |
| 26 |
add_action( 'cron_schedules', array( Charitable_Tracking::get_instance(), 'add_schedules' ) ); |
| 27 |
|
| 28 |
/** |
| 29 |
* Register the check-in. |
| 30 |
* |
| 31 |
* @see Charitable_Tracking::send_checkin() |
| 32 |
*/ |
| 33 |
add_action( 'charitable_usage_tracking_cron', array( Charitable_Tracking::get_instance(), 'send_checkins' ) ); |
| 34 |
|
| 35 |
/** |
| 36 |
* Testing the check-in. |
| 37 |
* |
| 38 |
* @see Charitable_Tracking::test_checkin() |
| 39 |
*/ |
| 40 |
add_action( 'init', array( Charitable_Tracking::get_instance(), 'test_checkin' ) ); |
| 41 |
|
| 42 |
/** |
| 43 |
* Save the time to first campaign. |
| 44 |
* |
| 45 |
* @see Charitable_Tracking::insert_time_to_first_campaign() |
| 46 |
*/ |
| 47 |
add_action( 'charitable_campaign_processor_save_core', array( Charitable_Tracking::get_instance(), 'insert_time_to_first_campaign' ), 10, 4 ); |
| 48 |
|
| 49 |
/** |
| 50 |
* Save the time to first donation. |
| 51 |
* |
| 52 |
* @see Charitable_Tracking::insert_time_to_first_donation() |
| 53 |
*/ |
| 54 |
add_action( 'charitable_after_save_donation', array( Charitable_Tracking::get_instance(), 'insert_time_to_first_donation' ), 10, 2 ); |
| 55 |
|