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/class-charitable-general-settings.php +228 -171 1.7.0.7 → 1.8.13 View file →
@@ -3,9 +3,9 @@
3 3 * Charitable General Settings UI.
4 4 *
5 5 * @package Charitable/Classes/Charitable_General_Settings
6 6 * @author David Bisset
7 - * @copyright Copyright (c) 2022, WP Charitable LLC
7 + * @copyright Copyright (c) 2023, WP Charitable LLC
8 8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 9 * @since 1.0.0
10 10 * @version 1.6.38
11 11 */
@@ -70,218 +70,275 @@
70 70
71 71 $currency_helper = charitable_get_currency_helper();
72 72
73 73 $general_fields = array(
74 - 'section' => array(
75 - 'title' => '',
76 - 'type' => 'hidden',
77 - 'priority' => 10000,
78 - 'value' => 'general',
74 + 'section' => array(
75 + 'title' => '',
76 + 'type' => 'hidden',
77 + 'priority' => 10000,
78 + 'value' => 'general',
79 79 ),
80 - 'section_license' => array(
81 - 'title' => __( 'License', 'charitable' ),
82 - 'type' => 'heading',
83 - 'priority' => 1,
84 - 'class' => 'section-heading general-settings',
85 - 'help' => __( 'Your license key provides access to updates and addons.', 'charitable' ),
80 + 'general_settings' => array(
81 + 'title' => __( 'General Settings', 'charitable' ),
82 + 'type' => 'heading',
83 + 'priority' => 1,
86 84 ),
87 - 'license_key' => array(
88 - 'title' => __( 'License Key', 'charitable' ),
89 - 'type' => 'content',
90 - 'class' => 'general-settings',
91 - 'content' => Charitable_Licenses_Settings::get_instance()->generate_license_check_html(),
92 - 'priority' => 2,
93 - 'help' => __( 'Your license key provides access to updates and addons.', 'charitable' ),
85 + 'section_license' => array(
86 + 'title' => __( 'License', 'charitable' ),
87 + 'type' => 'heading',
88 + 'priority' => 2,
89 + 'class' => 'section-heading general-settings',
94 90 ),
95 - 'section_locale' => array(
96 - 'title' => __( 'Currency & Location', 'charitable' ),
97 - 'type' => 'heading',
98 - 'class' => 'section-heading general-settings',
99 - 'priority' => 3,
91 + 'license_key' => array(
92 + 'title' => __( 'License Key', 'charitable' ),
93 + 'type' => 'content',
94 + 'class' => 'general-settings',
95 + 'content' => Charitable_Licenses_Settings::get_instance()->generate_license_check_html(),
96 + 'priority' => 3,
97 + 'help' => __( 'Your license key provides access to updates and addons.', 'charitable' ),
100 98 ),
101 - 'country' => array(
102 - 'title' => __( 'Base Country', 'charitable' ),
103 - 'type' => 'select',
104 - 'priority' => 4,
105 - 'default' => 'US',
106 - 'class' => 'general-settings',
107 - 'options' => charitable_get_location_helper()->get_countries(),
99 + 'section_locale' => array(
100 + 'title' => __( 'Currency & Location', 'charitable' ),
101 + 'type' => 'heading',
102 + 'class' => 'section-heading general-setting currrency-location',
103 + 'priority' => 4,
108 104 ),
109 - 'currency' => array(
110 - 'title' => __( 'Currency', 'charitable' ),
111 - 'type' => 'select',
112 - 'priority' => 10,
113 - 'default' => 'USD',
114 - 'class' => 'general-settings',
115 - 'options' => charitable_get_currency_helper()->get_all_currencies(),
105 + 'country' => array(
106 + 'title' => __( 'Base Country', 'charitable' ),
107 + 'type' => 'select',
108 + 'priority' => 8,
109 + 'default' => 'US',
110 + 'class' => 'general-setting',
111 + 'options' => charitable_get_location_helper()->get_countries(),
116 112 ),
117 - 'currency_format' => array(
118 - 'title' => __( 'Currency Format', 'charitable' ),
119 - 'type' => 'select',
120 - 'priority' => 12,
121 - 'default' => 'left',
122 - 'class' => 'general-settings',
123 - 'options' => array(
124 - 'left' => $currency_helper->get_monetary_amount( '23', false, false, 'left' ),
125 - 'right' => $currency_helper->get_monetary_amount( '23', false, false, 'right' ),
126 - 'left-with-space' => $currency_helper->get_monetary_amount( '23', false, false, 'left-with-space' ),
127 - 'right-with-space' => $currency_helper->get_monetary_amount( '23', false, false, 'right-with-space' ),
113 + 'currency' => array(
114 + 'title' => __( 'Currency', 'charitable' ),
115 + 'type' => 'select',
116 + 'priority' => 10,
117 + 'default' => 'USD',
118 + 'class' => 'general-settings',
119 + 'options' => charitable_get_currency_helper()->get_all_currencies(),
120 + ),
121 + 'currency_format' => array(
122 + 'title' => __( 'Currency Format', 'charitable' ),
123 + 'type' => 'select',
124 + 'priority' => 12,
125 + 'default' => 'left',
126 + 'class' => 'general-settings',
127 + 'options' => array(
128 + 'left' => $currency_helper->get_monetary_amount( '23', false, false, 'left' ),
129 + 'right' => $currency_helper->get_monetary_amount( '23', false, false, 'right' ),
130 + 'left-with-space' => $currency_helper->get_monetary_amount( '23', false, false, 'left-with-space' ),
131 + 'right-with-space' => $currency_helper->get_monetary_amount( '23', false, false, 'right-with-space' ),
128 132 ),
129 133 ),
130 - 'decimal_separator' => array(
131 - 'title' => __( 'Decimal Separator', 'charitable' ),
132 - 'type' => 'select',
133 - 'priority' => 14,
134 - 'default' => '.',
135 - 'class' => 'general-settings',
136 - 'options' => array(
134 + 'decimal_separator' => array(
135 + 'title' => __( 'Decimal Separator', 'charitable' ),
136 + 'type' => 'select',
137 + 'priority' => 14,
138 + 'default' => '.',
139 + 'class' => 'general-settings',
140 + 'options' => array(
137 141 '.' => 'Period (12.50)',
138 142 ',' => 'Comma (12,50)',
139 143 ),
140 144 ),
141 - 'thousands_separator' => array(
142 - 'title' => __( 'Thousands Separator', 'charitable' ),
143 - 'type' => 'select',
144 - 'priority' => 16,
145 - 'default' => ',',
146 - 'class' => 'general-settings',
147 - 'options' => array(
148 - ',' => __( 'Comma (10,000)', 'charitable' ),
149 - '.' => __( 'Period (10.000)', 'charitable' ),
150 - ' ' => __( 'Space (10 000)', 'charitable' ),
151 - 'none' => __( 'None', 'charitable' ),
145 + 'thousands_separator' => array(
146 + 'title' => __( 'Thousands Separator', 'charitable' ),
147 + 'type' => 'select',
148 + 'priority' => 16,
149 + 'default' => ',',
150 + 'class' => 'general-settings',
151 + 'options' => array(
152 + ',' => __( 'Comma (10,000)', 'charitable' ),
153 + '.' => __( 'Period (10.000)', 'charitable' ),
154 + ' ' => __( 'Space (10 000)', 'charitable' ),
155 + 'none' => __( 'None', 'charitable' ),
152 156 ),
153 157 ),
154 - 'decimal_count' => array(
155 - 'title' => __( 'Number of Decimals', 'charitable' ),
156 - 'type' => 'number',
157 - 'priority' => 18,
158 - 'class' => 'general-settings',
159 - 'default' => 2,
160 - 'class' => 'short',
158 + 'decimal_count' => array(
159 + 'title' => __( 'Number of Decimals', 'charitable' ),
160 + 'type' => 'number',
161 + 'priority' => 18,
162 + 'class' => 'general-settings short',
163 + 'default' => 2,
161 164 ),
162 - 'section_donation_form' => array(
163 - 'title' => __( 'Donation Form', 'charitable' ),
164 - 'type' => 'heading',
165 - 'class' => 'section-heading general-settings',
166 - 'priority' => 20,
165 + 'section_donation_form' => array(
166 + 'title' => __( 'Donation Form', 'charitable' ),
167 + 'type' => 'heading',
168 + 'class' => 'section-heading general-settings',
169 + 'priority' => 20,
167 170 ),
168 - 'donation_form_display' => array(
169 - 'title' => __( 'Display Options', 'charitable' ),
170 - 'type' => 'select',
171 - 'priority' => 22,
172 - 'default' => 'separate_page',
173 - 'class' => 'general-settings',
174 - 'options' => array(
171 + 'donation_form_display' => array(
172 + 'title' => __( 'Display Options', 'charitable' ),
173 + 'type' => 'select',
174 + 'priority' => 22,
175 + 'default' => 'modal',
176 + 'class' => 'general-settings',
177 + 'options' => array(
175 178 'separate_page' => __( 'Show on a Separate Page', 'charitable' ),
176 179 'same_page' => __( 'Show on the Same Page', 'charitable' ),
177 180 'modal' => __( 'Reveal in a Modal', 'charitable' ),
178 181 ),
179 - 'help' => __( 'Choose how you want a campaign\'s donation form to show.', 'charitable' ),
182 + 'help' => __( 'Choose how you want a campaign\'s donation form to show.', 'charitable' ),
180 183 ),
181 - 'donation_form_minimal_fields' => array(
182 - 'title' => __( 'Only show required fields', 'charitable' ),
183 - 'type' => 'radio',
184 - 'priority' => 24,
185 - 'class' => 'general-settings',
186 - 'default' => '0',
187 - 'options' => array(
188 - '1' => __( 'Yes', 'charitable' ),
189 - '0' => __( 'No', 'charitable' ),
184 + 'donation_form_template' => array(
185 + 'title' => __( 'Form Template <span class="badge beta">Beta</span>', 'charitable' ),
186 + 'type' => 'select',
187 + 'priority' => 23,
188 + 'default' => '',
189 + 'class' => 'general-settings',
190 + 'options' => array(
191 + '' => __( 'Standard', 'charitable' ),
192 + 'minimal' => __( 'Minimal', 'charitable' ),
190 193 ),
191 - 'help' => __( 'Choose if you wish fields not required on the donation form to be hidden.', 'charitable' ),
194 + 'help' => __( 'The minimal template has a more compact and simplified layout. It is most effective with "only show required fields" set to "Yes".', 'charitable' ),
192 195 ),
196 + 'donation_form_minimal_fields' => array(
197 + 'title' => __( 'Only Show Required Fields', 'charitable' ),
198 + 'type' => 'radio',
199 + 'priority' => 24,
200 + 'class' => 'general-settings',
201 + 'default' => '0',
202 + 'options' => array(
203 + '1' => __( 'Yes', 'charitable' ),
204 + '0' => __( 'No', 'charitable' ),
205 + ),
206 + 'help' => __( 'Choose if you wish fields not required on the donation form to be hidden.', 'charitable' ),
207 + ),
208 + 'donation_form_show_login_message' => array(
209 + 'title' => __( 'Show Login Form <span class="badge beta">Beta</span>', 'charitable' ),
210 + 'type' => 'radio',
211 + 'priority' => 25,
212 + 'class' => 'general-settings',
213 + 'default' => '1',
214 + 'options' => array(
215 + '1' => __( 'Yes', 'charitable' ),
216 + '0' => __( 'No', 'charitable' ),
217 + ),
218 + 'help' => __( 'Choose if you wish to display a register reminder or login form at the top of the donation form.', 'charitable' ),
219 + ),
193 220 'donation_form_minimal_amount_notice_display' => array(
194 - 'title' => __( 'Minimum donation location <span class="badge beta">Beta</span>', 'charitable' ),
195 - 'type' => 'select',
196 - 'priority' => 26,
197 - 'class' => 'general-settings',
198 - 'default' => 'below_amount_selection',
199 - 'options' => array(
200 - 'below_amount_selection' => __( 'Below donation choices / amounts', 'charitable' ),
201 - 'below_donation_title' => __( 'Below donation title', 'charitable' ),
202 - 'above_donation_title' => __( 'Above donation title', 'charitable' ),
221 + 'title' => __( 'Minimum Donation Location', 'charitable' ),
222 + 'type' => 'select',
223 + 'priority' => 26,
224 + 'class' => 'general-settings',
225 + 'default' => 'below_amount_selection',
226 + 'options' => array(
227 + 'below_amount_selection' => __( 'Below Donation Choices / Amounts', 'charitable' ),
228 + 'below_donation_title' => __( 'Below Donation Title', 'charitable' ),
229 + 'above_donation_title' => __( 'Above Donation Title', 'charitable' ),
203 230 ),
204 - 'help' => __( 'Choose where you wish the minimum donation message to appear on the donation form, if a minimum is set for the campaign.', 'charitable' ),
231 + 'help' => __( 'Choose where you wish the minimum donation message to appear on the donation form, if a minimum is set for the campaign.', 'charitable' ),
205 232 ),
206 - 'donation_form_notices_display' => array(
207 - 'title' => __( 'Notice display location <span class="badge beta">Beta</span>', 'charitable' ),
208 - 'type' => 'select',
209 - 'priority' => 28,
210 - 'default' => 'top',
211 - 'class' => 'general-settings',
212 - 'options' => array(
213 - 'top' => __( 'Top', 'charitable' ),
214 - 'bottom' => __( 'Bottom', 'charitable' ),
233 + 'donation_form_notices_display' => array(
234 + 'title' => __( 'Notice Display Location', 'charitable' ),
235 + 'type' => 'select',
236 + 'priority' => 27,
237 + 'default' => 'top',
238 + 'class' => 'general-settings',
239 + 'options' => array(
240 + 'top' => __( 'Top', 'charitable' ),
241 + 'bottom' => __( 'Bottom', 'charitable' ),
215 242 ),
216 - 'help' => __( 'Choose where notice and validation errors appear on the donation form.', 'charitable' ),
243 + 'help' => __( 'Choose where notice and validation errors appear on the donation form.', 'charitable' ),
217 244 ),
218 245 'donation_form_default_highlight_colour' => array(
219 - 'title' => __( 'Default highlight color <span class="badge beta">Beta</span>', 'charitable' ),
220 - 'type' => 'text',
221 - 'priority' => 28,
222 - 'default' => false,
223 - 'class' => 'general-settings',
224 - 'help' => __( 'Define a Hexadecimal value for a highlight color for form notices, errors, and other UI. Leave blank for ', 'charitable' ) . apply_filters( 'charitable_default_highlight_colour', '#f89d35' ) . ' (default) or if your theme css already overrides.',
246 + 'title' => __( 'Default Highlight Color', 'charitable' ),
247 + 'type' => 'color-picker',
248 + 'priority' => 28,
249 + 'default' => false,
250 + 'class' => 'general-settings charitable-color-field',
251 + 'help' => __( 'Define a highlight color for form notices, errors, and other UI. Default is ', 'charitable' ) . apply_filters( 'charitable_default_highlight_colour', '#f89d35' ) . '. Templates built in Campaign Builder or CSS in your theme or plugins might override this.',
225 252 ),
226 - 'section_pages' => array(
227 - 'title' => __( 'Pages', 'charitable' ),
228 - 'type' => 'heading',
229 - 'class' => 'section-heading general-settings',
230 - 'priority' => 30,
253 + 'section_pages' => array(
254 + 'title' => __( 'Pages', 'charitable' ),
255 + 'type' => 'heading',
256 + 'class' => 'section-heading general-settings',
257 + 'priority' => 30,
231 258 ),
232 - 'login_page' => array(
233 - 'title' => __( 'Login Page', 'charitable' ),
234 - 'type' => 'select',
235 - 'class' => 'general-settings',
236 - 'priority' => 32,
237 - 'default' => 'wp',
238 - 'options' => array(
239 - 'wp' => __( 'Use WordPress Login', 'charitable' ),
240 - 'pages' => array(
241 - 'options' => charitable_get_admin_settings()->get_pages(),
242 - 'label' => __( 'Choose a Static Page', 'charitable' ),
259 + 'login_page' => array(
260 + 'title' => __( 'Login Page', 'charitable' ),
261 + 'type' => 'select',
262 + 'class' => 'general-settings',
263 + 'priority' => 31,
264 + 'default' => 'wp',
265 + 'options' => array(
266 + 'wp' => __( 'Use WordPress Login', 'charitable' ),
267 + 'pages' => array(
268 + 'options' => charitable_get_admin_settings()->get_pages(),
269 + 'label' => __( 'Choose a Static Page', 'charitable' ),
243 270 ),
244 271 ),
245 - 'help' => __( 'Allow users to login via the normal WordPress login page or via a static page. The static page should contain the <code>[charitable_login]</code> shortcode.', 'charitable' ),
272 + 'help' => __( 'Allow users to login via the normal WordPress login page or via a static page. The static page should contain the <code>[charitable_login]</code> shortcode.', 'charitable' ),
246 273 ),
247 - 'registration_page' => array(
248 - 'title' => __( 'Registration Page', 'charitable' ),
249 - 'type' => 'select',
250 - 'priority' => 34,
251 - 'default' => 'wp',
252 - 'class' => 'general-settings',
253 - 'options' => array(
254 - 'wp' => __( 'Use WordPress Registration Page', 'charitable' ),
255 - 'pages' => array(
256 - 'options' => charitable_get_admin_settings()->get_pages(),
257 - 'label' => __( 'Choose a Static Page', 'charitable' ),
274 + 'registration_page' => array(
275 + 'title' => __( 'Registration Page', 'charitable' ),
276 + 'type' => 'select',
277 + 'priority' => 32,
278 + 'default' => 'wp',
279 + 'class' => 'general-settings',
280 + 'options' => array(
281 + 'wp' => __( 'Use WordPress Registration Page', 'charitable' ),
282 + 'pages' => array(
283 + 'options' => charitable_get_admin_settings()->get_pages(),
284 + 'label' => __( 'Choose a Static Page', 'charitable' ),
258 285 ),
259 286 ),
260 - 'help' => __( 'Allow users to register via the default WordPress login or via a static page. The static page should contain the <code>[charitable_registration]</code> shortcode.', 'charitable' ),
287 + 'help' => __( 'Allow users to register via the default WordPress login or via a static page. The static page should contain the <code>[charitable_registration]</code> shortcode.', 'charitable' ),
261 288 ),
262 - 'profile_page' => array(
263 - 'title' => __( 'Profile Page', 'charitable' ),
264 - 'type' => 'select',
265 - 'priority' => 36,
266 - 'class' => 'general-settings',
267 - 'options' => charitable_get_admin_settings()->get_pages(),
268 - 'help' => __( 'The static page should contain the <code>[charitable_profile]</code> shortcode.', 'charitable' ),
289 + 'profile_page' => array(
290 + 'title' => __( 'Profile Page', 'charitable' ),
291 + 'type' => 'select',
292 + 'priority' => 33,
293 + 'class' => 'general-settings',
294 + 'options' => charitable_get_admin_settings()->get_pages(),
295 + 'help' => __( 'The static page should contain the <code>[charitable_profile]</code> shortcode.', 'charitable' ),
269 296 ),
270 - 'donation_receipt_page' => array(
271 - 'title' => __( 'Donation Receipt Page', 'charitable' ),
272 - 'type' => 'select',
273 - 'priority' => 38,
274 - 'default' => 'auto',
275 - 'class' => 'general-settings',
276 - 'options' => array(
277 - 'auto' => __( 'Automatic', 'charitable' ),
278 - 'pages' => array(
279 - 'options' => charitable_get_admin_settings()->get_pages(),
280 - 'label' => __( 'Choose a Static Page', 'charitable' ),
297 + 'donation_receipt_page' => array(
298 + 'title' => __( 'Donation Receipt Page', 'charitable' ),
299 + 'type' => 'select',
300 + 'priority' => 34,
301 + 'default' => 'auto',
302 + 'class' => 'general-settings',
303 + 'options' => array(
304 + 'auto' => __( 'Automatic', 'charitable' ),
305 + 'pages' => array(
306 + 'options' => charitable_get_admin_settings()->get_pages(),
307 + 'label' => __( 'Choose a Static Page', 'charitable' ),
281 308 ),
282 309 ),
283 - 'help' => __( 'Choose the page that users will be redirected to after donating. Leave it set to automatic to use the built-in Charitable receipt. If you choose a static page, it should contain the <code>[donation_receipt]</code> shortcode.', 'charitable' ),
310 + 'help' => __( 'Choose the page that users will be redirected to after donating. Leave it set to automatic to use the built-in Charitable receipt. If you choose a static page, it should contain the <code>[donation_receipt]</code> shortcode.', 'charitable' ),
311 + ),
312 + 'privacy_policy_page' => array(
313 + 'title' => __( 'Privacy Policy Page', 'charitable' ),
314 + 'type' => 'select',
315 + 'class' => 'general-settings',
316 + 'priority' => 40,
317 + 'default' => '0',
318 + 'options' => array(
319 + '0' => __( 'No Privacy Page', 'charitable' ),
320 + 'pages' => array(
321 + 'options' => charitable_get_admin_settings()->get_pages(),
322 + 'label' => __( 'Choose a Static Page', 'charitable' ),
323 + ),
324 + ),
325 + 'help' => __( 'Choose the page that contains your site\'s privacy policy.', 'charitable' ),
326 + ),
327 + 'terms_conditions_page' => array(
328 + 'title' => __( 'Terms and Conditions Page', 'charitable' ),
329 + 'type' => 'select',
330 + 'priority' => 45,
331 + 'default' => '0',
332 + 'class' => 'general-settings',
333 + 'options' => array(
334 + '0' => __( 'No Terms Page', 'charitable' ),
335 + 'pages' => array(
336 + 'options' => charitable_get_admin_settings()->get_pages(),
337 + 'label' => __( 'Choose a Static Page', 'charitable' ),
338 + ),
339 + ),
340 + 'help' => __( 'Choose the page that contains your site\'s terms and conditions.', 'charitable' ),
284 341 ),
285 342 );
286 343
287 344 /* If we're using a zero-decimal currency, get rid of the decimal separator and decimal number fields */