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 +74 -13 1.7.0.7 → 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 */
@@ -106,23 +114,32 @@
106 114 */
107 115 add_filter( 'charitable_settings_tab_fields_privacy', array( Charitable_Privacy_Settings::get_instance(), 'add_privacy_fields' ), 5 );
108 116
109 117 /**
110 - * Add settings to the Tools tab.
118 + * Add the Pro settings CTA.
111 119 *
112 - * @see Charitable_Tools_Settings::add_import_fields()
120 + * @see Charitable_Settings::show_settings_cta()
113 121 */
114 -add_filter( 'charitable_settings_tab_fields_tools', array( Charitable_Tools_Settings::get_instance(), 'add_tools_fields' ), 5 );
122 +add_action( 'charitable_pro_settings_cta', array( Charitable_Settings::get_instance(), 'show_settings_cta' ), 10, 1 );
115 123
124 +
116 125 /**
117 - * Look for export/import attempts.
126 + * Add security settings group.
118 127 *
119 - * @see Charitable_Export_Settings::add_export_fields()
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
120 132 */
121 -add_action( 'admin_init', array( Charitable_Export_Items::get_instance(), 'admin_accept_export_campaign_request' ) );
122 -add_action( 'admin_init', array( Charitable_Export_Items::get_instance(), 'admin_accept_export_donations_request' ) );
123 -add_action( 'admin_init', array( Charitable_Import_Items::get_instance(), 'admin_accept_import_campaign_request' ) );
124 -add_action( 'admin_init', array( Charitable_Import_Items::get_instance(), 'admin_accept_import_donations_request' ) );
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 +} );
125 142
126 143 /**
127 144 * Add settings to the Advanced tab.
128 145 *
@@ -130,13 +147,19 @@
130 147 */
131 148 add_filter( 'charitable_settings_tab_fields_advanced', array( Charitable_Advanced_Settings::get_instance(), 'add_advanced_fields' ), 5 );
132 149
133 150 /**
134 - * Preform any tasks when the advannced tab is saved.
151 + * Preform any tasks when the advanced tab is saved.
135 152 *
136 153 * @see Charitable_Advanced_Settings::save_license()
137 154 */
138 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 );
139 162
140 163 /**
141 164 * Add extra settings for the individual gateways & emails tabs.
142 165 *
@@ -150,5 +173,43 @@
150 173 * Add Addons Directory
151 174 *
152 175 * @see Charitable_Advanced_Settings::add_advanced_fields()
153 176 */
154 -add_filter( 'charitable_addons_directory_settings_page_start', array( Charitable_Addons_Directory::get_instance(), 'test' ), 5 );
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 );