← All changes
|
includes/donations/charitable-donation-hooks.php
+26
-1
1.7.0.2
→
1.8.13
View file →
| @@ -5,9 +5,9 @@ | ||
| 5 | 5 | * Action/filter hooks used for Charitable donations. |
| 6 | 6 | * |
| 7 | 7 | * @package Charitable/Functions/Donations |
| 8 | 8 | * @author David Bisset |
| 9 | - * @copyright Copyright (c) 2022, WP Charitable LLC | |
| 9 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 10 | 10 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 11 | 11 | * @since 1.0.0 |
| 12 | 12 | * @version 1.6.34 |
| 13 | 13 | */ |
| @@ -124,4 +124,29 @@ | ||
| 124 | 124 | * @see charitable_update_cached_donation() |
| 125 | 125 | */ |
| 126 | 126 | add_action( 'charitable_donation_status_changed', 'charitable_update_cached_donation' ); |
| 127 | 127 | add_action( 'charitable_recurring_donation_status_changed', 'charitable_update_cached_donation' ); |
| 128 | + | |
| 129 | +/** | |
| 130 | + * Upon security check failure, update the total number of errors to allow a notice to be displayed. | |
| 131 | + * | |
| 132 | + * @see Charitable_Donation_Notice::update_security_check_error_total | |
| 133 | + * @see Charitable_Donation_Notice::get_dashboard_notices | |
| 134 | + */ | |
| 135 | +add_filter( 'charitable_validate_donation_form_submission_security_check', array( Charitable_Donation_Notices::get_instance(), 'update_security_check_error_total' ), 10, 2 ); | |
| 136 | +add_filter( 'charitable_admin_dashboard_init_end', array( Charitable_Donation_Notices::get_instance(), 'get_dashboard_notices' ), 10 ); | |
| 137 | + | |
| 138 | +/** | |
| 139 | + * Schedule cleanup of old donation form error logs. | |
| 140 | + * | |
| 141 | + * @see charitable_schedule_error_log_cleanup() | |
| 142 | + * @see charitable_cleanup_old_form_errors() | |
| 143 | + */ | |
| 144 | +add_action( 'init', 'charitable_schedule_error_log_cleanup' ); | |
| 145 | +add_action( 'charitable_daily_error_log_cleanup', 'charitable_cleanup_old_form_errors' ); | |
| 146 | + | |
| 147 | +/** | |
| 148 | + * Register cleanup for plugin deactivation when plugin is loaded. | |
| 149 | + * | |
| 150 | + * @see charitable_cleanup_error_log_cron_on_deactivation() | |
| 151 | + */ | |
| 152 | +add_action( 'charitable_start', 'charitable_register_error_log_deactivation_hook' ); | |