PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
← All changes | includes/admin/settings/charitable-settings-admin-hooks.php +95 -2 1.7.0.3 → 1.8.13 View file →
@@ -5,12 +5,13 @@
5 5 * Action/filter hooks used for Charitable Settings API.
6 6 *
7 7 * @package Charitable/Functions/Admin
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.2.0
12 - * @version 1.6.0
12 + * @version 1.8.4 - added user tracking option.
13 + * @version 1.8.6.2 - added sanitization functions for privacy policy, terms and conditions, and contact consent label fields.
13 14 */
14 15
15 16 // Exit if accessed directly.
16 17 if ( ! defined( 'ABSPATH' ) ) {
@@ -24,8 +25,15 @@
24 25 */
25 26 add_action( 'admin_init', array( Charitable_Settings::get_instance(), 'register_settings' ) );
26 27
27 28 /**
29 + * Redirect to the default Marketing sub-tab (newsletters) when no sub_tab is supplied.
30 + *
31 + * @see Charitable_Settings::marketing_sub_tab_default()
32 + */
33 +add_action( 'admin_init', array( Charitable_Settings::get_instance(), 'marketing_sub_tab_default' ), 5 );
34 +
35 +/**
28 36 * Maybe add "Licenses" settings tab.
29 37 *
30 38 * @see Charitable_Settings::maybe_add_extensions_tab()
31 39 */
@@ -96,8 +104,9 @@
96 104 *
97 105 * @see Charitable_Licenses_Settings::add_license_recheck_button()
98 106 */
99 107 add_filter( 'charitable_settings_button_licenses', array( Charitable_Licenses_Settings::get_instance(), 'add_license_recheck_button' ) );
108 +add_filter( 'charitable_settings_button_advanced', array( Charitable_Licenses_Settings::get_instance(), 'add_license_recheck_button' ) );
100 109
101 110 /**
102 111 * Add settings to the Privacy tab.
103 112 *
@@ -105,8 +114,34 @@
105 114 */
106 115 add_filter( 'charitable_settings_tab_fields_privacy', array( Charitable_Privacy_Settings::get_instance(), 'add_privacy_fields' ), 5 );
107 116
108 117 /**
118 + * Add the Pro settings CTA.
119 + *
120 + * @see Charitable_Settings::show_settings_cta()
121 + */
122 +add_action( 'charitable_pro_settings_cta', array( Charitable_Settings::get_instance(), 'show_settings_cta' ), 10, 1 );
123 +
124 +
125 +/**
126 + * Add security settings group.
127 + *
128 + * This ensures the 'security' group is recognized by the settings API.
129 + * Settings will be added via the charitable_settings_tab_fields_security filter.
130 + *
131 + * @since 1.8.0
132 + */
133 +add_filter( 'charitable_security_admin_settings_groups', function( $groups ) {
134 + if ( ! is_array( $groups ) ) {
135 + $groups = array();
136 + }
137 + if ( ! in_array( 'security', $groups, true ) ) {
138 + $groups[] = 'security';
139 + }
140 + return $groups;
141 +} );
142 +
143 +/**
109 144 * Add settings to the Advanced tab.
110 145 *
111 146 * @see Charitable_Advanced_Settings::add_advanced_fields()
112 147 */
@@ -112,8 +147,21 @@
112 147 */
113 148 add_filter( 'charitable_settings_tab_fields_advanced', array( Charitable_Advanced_Settings::get_instance(), 'add_advanced_fields' ), 5 );
114 149
115 150 /**
151 + * Preform any tasks when the advanced tab is saved.
152 + *
153 + * @see Charitable_Advanced_Settings::save_license()
154 + */
155 +add_filter( 'charitable_save_settings', array( Charitable_Advanced_Settings::get_instance(), 'clear_expired_options' ), 10, 2 );
156 +add_filter( 'charitable_save_settings', array( Charitable_Advanced_Settings::get_instance(), 'clear_activity_database' ), 10, 2 );
157 +add_filter( 'charitable_save_settings', array( Charitable_Advanced_Settings::get_instance(), 'minification_settings' ), 10, 2 );
158 +add_filter( 'charitable_save_settings', array( Charitable_Checklist::get_instance(), 'confirm_general_settings' ), 10, 2 );
159 +add_filter( 'charitable_save_settings', array( Charitable_Checklist::get_instance(), 'confirm_email_settings' ), 10, 2 );
160 +add_filter( 'charitable_save_settings', array( Charitable_Advanced_Settings::get_instance(), 'update_user_tracking_option' ), 10, 2 );
161 +add_filter( 'admin_init', array( Charitable_Checklist::get_instance(), 'confirm_email_changes' ), 10 );
162 +
163 +/**
116 164 * Add extra settings for the individual gateways & emails tabs.
117 165 *
118 166 * @see Charitable_Gateway_Settings::add_individual_gateway_fields()
119 167 * @see Charitable_Email_Settings::add_individual_email_fields()
@@ -119,4 +167,49 @@
119 167 * @see Charitable_Email_Settings::add_individual_email_fields()
120 168 */
121 169 add_filter( 'charitable_settings_tab_fields', array( Charitable_Gateway_Settings::get_instance(), 'add_individual_gateway_fields' ), 5 );
122 170 add_filter( 'charitable_settings_tab_fields', array( Charitable_Email_Settings::get_instance(), 'add_individual_email_fields' ), 5 );
171 +
172 +/**
173 + * Add Addons Directory
174 + *
175 + * @see Charitable_Advanced_Settings::add_advanced_fields()
176 + */
177 +add_action( 'admin_init', array( Charitable_Addons_Directory::get_instance(), 'init' ), 5 );
178 +
179 +/**
180 + * Checklist.
181 + *
182 + * @see Charitable_Checklist::maybe_redirect_to_checklist_after_event()
183 + */
184 +add_action( 'charitable_save_settings', array( Charitable_Checklist::get_instance(), 'maybe_redirect_to_checklist_after_event' ), 99, 2 );
185 +add_filter( 'admin_body_class', array( Charitable_Checklist::get_instance(), 'add_body_class' ), 10 );
186 +add_filter( 'charitable_submenu_pages', array( Charitable_Checklist::get_instance(), 'add_checklist_to_menu' ), 2 );
187 +add_action( 'admin_init', array( Charitable_Checklist::get_instance(), 'maybe_complete_checklist' ), 10 );
188 +
189 +/**
190 + * Maybe activate the Pro plugin after onboarding.
191 + *
192 + * @see Charitable_Checklist::maybe_activate_pro_after_onboarding()
193 + */
194 +add_action( 'admin_init', array( Charitable_Checklist::get_instance(), 'maybe_activate_pro_after_onboarding' ), 10 );
195 +
196 +/**
197 + * Hook the sanitization function for the privacy_policy field.
198 + *
199 + * @see Charitable_Privacy_Settings::sanitize_privacy_policy_field()
200 + */
201 +add_filter( 'charitable_sanitize_value_privacy_privacy_policy', array( Charitable_Privacy_Settings::get_instance(), 'sanitize_privacy_policy_field' ), 10, 3 );
202 +
203 +/**
204 + * Hook the sanitization function for the terms_conditions field.
205 + *
206 + * @see Charitable_Privacy_Settings::sanitize_terms_conditions_field()
207 + */
208 +add_filter( 'charitable_sanitize_value_privacy_terms_conditions', array( Charitable_Privacy_Settings::get_instance(), 'sanitize_terms_conditions_field' ), 10, 3 );
209 +
210 +/**
211 + * Hook the sanitization function for the contact_consent_label field.
212 + *
213 + * @see Charitable_Privacy_Settings::sanitize_contact_consent_label_field()
214 + */
215 +add_filter( 'charitable_sanitize_value_privacy_contact_consent_label', array( Charitable_Privacy_Settings::get_instance(), 'sanitize_contact_consent_label_field' ), 10, 3 );