PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / trunk
GiveWP – Donation Plugin and Fundraising Platform vtrunk
4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / admin / settings / class-settings-general.php
give / includes / admin / settings Last commit date
class-settings-addon.php 6 years ago class-settings-advanced.php 5 months ago class-settings-display.php 2 years ago class-settings-email.php 11 months ago class-settings-gateways.php 1 year ago class-settings-general.php 1 year ago class-settings-license.php 1 month ago class-settings-recurring.php 1 year ago
class-settings-general.php
718 lines
1 <?php
2 /**
3 * Give Settings Page/Tab
4 *
5 * @package Give
6 * @since 1.8
7 * @copyright Copyright (c) 2016, GiveWP
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @subpackage Classes/Give_Settings_General
10 */
11
12 if (!defined('ABSPATH')) {
13 exit; // Exit if accessed directly.
14 }
15
16 if (!class_exists('Give_Settings_General')) :
17
18 /**
19 * Give_Settings_General.
20 *
21 * @sine 1.8
22 */
23 class Give_Settings_General extends Give_Settings_Page
24 {
25
26 /**
27 * Constructor.
28 */
29 public function __construct()
30 {
31 $this->id = 'general';
32 $this->label = __('General', 'give');
33
34 $this->default_tab = 'general-settings';
35
36 if ($this->id === give_get_current_setting_tab()) {
37 add_action('give_save_settings_give_settings', [$this, '_give_change_donation_stating_number'], 10, 3);
38 add_action(
39 'give_admin_field_give_sequential_donation_code_preview',
40 [$this, '_render_give_sequential_donation_code_preview'],
41 10,
42 3
43 );
44 add_action('give_admin_field_give_currency_preview', [$this, '_render_give_currency_preview'], 10, 2);
45 add_action(
46 'give_admin_field_give_unlock_all_settings',
47 [$this, '_render_give_unlock_all_settings'],
48 10,
49 3
50 );
51 }
52
53 parent::__construct();
54 }
55
56 /**
57 * Get settings array.
58 *
59 * @since 2.24.2 add auto_format_currency setting
60 * @since 1.8
61 *
62 * @return array
63 */
64 public function get_settings()
65 {
66 $settings = [];
67 $current_section = give_get_current_setting_section();
68
69 switch ($current_section) {
70 case 'access-control':
71 $settings = [
72 // Section 3: Access control.
73 [
74 'id' => 'give_title_session_control_1',
75 'type' => 'title',
76 ],
77 [
78 'id' => 'session_lifetime',
79 'name' => __('Session Lifetime', 'give'),
80 'desc' => __(
81 'The length of time a user\'s session is kept alive. GiveWP starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.',
82 'give'
83 ),
84 'type' => 'select',
85 'options' => [
86 '86400' => __('24 Hours', 'give'),
87 '172800' => __('48 Hours', 'give'),
88 '259200' => __('72 Hours', 'give'),
89 '604800' => __('1 Week', 'give'),
90 ],
91 ],
92 [
93 'id' => 'limit_display_donations',
94 'name' => __('Limit Donations Displayed', 'give'),
95 'desc' => __(
96 'Adjusts the number of donations displayed to a non logged-in user when they attempt to access the Donation History page without an active session. For security reasons, it\'s best to leave this at 1-3 donations.',
97 'give'
98 ),
99 'default' => '1',
100 'type' => 'number',
101 'css' => 'width:50px;',
102 'attributes' => [
103 'min' => '1',
104 'max' => '10',
105 ],
106 ],
107 [
108 'name' => __('Email Access', 'give'),
109 'desc' => __(
110 'If enabled, donors can access their donation history by verifying access to the email address used to donate. When they visit the donation history page, they input their email address and can access the site from a link in the resulting email.',
111 'give'
112 ),
113 'id' => 'email_access',
114 'type' => 'radio_inline',
115 'default' => 'disabled',
116 'options' => [
117 'enabled' => __('Enabled', 'give'),
118 'disabled' => __('Disabled', 'give'),
119 ],
120 ],
121 [
122 'name' => __('Enable reCAPTCHA', 'give'),
123 'desc' => __(
124 'If enabled, this option adds a reCAPTCHA field to the email access form. Note: this does not add reCAPTCHA to donation forms.',
125 'give'
126 ),
127 'id' => 'enable_recaptcha',
128 'type' => 'radio_inline',
129 'default' => 'disabled',
130 'options' => [
131 'enabled' => __('Enabled', 'give'),
132 'disabled' => __('Disabled', 'give'),
133 ],
134 ],
135 [
136 'id' => 'recaptcha_key',
137 'name' => __('reCAPTCHA Site Key', 'give'),
138 /* translators: %s: https://www.google.com/recaptcha/ */
139 'desc' => sprintf(
140 __(
141 'Navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key and paste your reCAPTCHA site key here. The reCAPTCHA uses Google\'s user-friendly single click verification method.',
142 'give'
143 ),
144 esc_url('http://docs.givewp.com/recaptcha')
145 ),
146 'default' => '',
147 'type' => 'text',
148 ],
149 [
150 'id' => 'recaptcha_secret',
151 'name' => __('reCAPTCHA Secret Key', 'give'),
152 'desc' => __(
153 'Please paste the reCAPTCHA secret key here from your reCAPTCHA API Keys panel.',
154 'give'
155 ),
156 'default' => '',
157 'type' => 'text',
158 ],
159 [
160 'name' => __('Access Control Docs Link', 'give'),
161 'id' => 'access_control_docs_link',
162 'url' => esc_url('http://docs.givewp.com/settings-access-control'),
163 'title' => __('Access Control', 'give'),
164 'type' => 'give_docs_link',
165 ],
166 [
167 'id' => 'give_title_session_control_1',
168 'type' => 'sectionend',
169 ],
170 ];
171 break;
172
173 case 'currency-settings':
174 $currency_position_before = __('Before - %s&#x200e;10', 'give');
175 $currency_position_after = __('After - 10%s&#x200f;', 'give');
176
177 $hasIntlExtension = class_exists(NumberFormatter::class);
178 $formatDisabledAttribute = $hasIntlExtension || give_get_option('auto_format_currency') ? [] : [
179 'disabled' => 'disabled',
180 'title' => __('This option is disabled because the PHP Intl extension is not installed.', 'give'),
181 ];
182
183 $settings = [
184 // Section 2: Currency
185 [
186 'type' => 'title',
187 'id' => 'give_title_general_settings_2',
188 ],
189 [
190 'name' => __('Currency Settings', 'give'),
191 'desc' => '',
192 'type' => 'give_title',
193 'id' => 'give_title_general_settings_2',
194 ],
195 [
196 'name' => __('Currency', 'give'),
197 'desc' => __(
198 'The donation currency. Note that some payment gateways have currency restrictions.',
199 'give'
200 ),
201 'id' => 'currency',
202 'class' => 'give-select-chosen',
203 'type' => 'select',
204 'options' => give_get_currencies(),
205 'default' => 'USD',
206 'attributes' => [
207 'data-formatting-setting' => esc_js(wp_json_encode(give_get_currencies_list())),
208 ],
209 ],
210 [
211 'name' => __('Auto-format server currency amounts', 'give'),
212 'desc' => sprintf(
213 /* translators: %s: Link to the GiveWP docs. */
214 __(
215 'If enabled, amounts are automatically formatted based on the selected currency. This option requires the intl extension for PHP. Read more about <a href="%s" target="_blank">this option and how GiveWP values internationalization in web applications.</a>',
216 'give'
217 ),
218 'https://docs.givewp.com/currency-format'
219 ),
220 'id' => 'auto_format_currency',
221 'type' => 'checkbox',
222 'attributes' => $formatDisabledAttribute,
223 ],
224 [
225 'name' => __('Currency Position', 'give'),
226 'desc' => __('The position of the currency symbol.', 'give'),
227 'id' => 'currency_position',
228 'type' => 'select',
229 'options' => [
230 /* translators: %s: currency symbol */
231 'before' => sprintf(
232 $currency_position_before,
233 give_currency_symbol(give_get_currency())
234 ),
235 /* translators: %s: currency symbol */
236 'after' => sprintf($currency_position_after, give_currency_symbol(give_get_currency())),
237 ],
238 'default' => 'before',
239 'attributes' => [
240 'data-before-template' => sprintf($currency_position_before, '{currency_pos}'),
241 'data-after-template' => sprintf($currency_position_after, '{currency_pos}'),
242 ],
243 ],
244 [
245 'name' => __('Thousands Separator', 'give'),
246 'desc' => __('The symbol (typically , or .) to separate thousands.', 'give'),
247 'id' => 'thousands_separator',
248 'type' => 'text',
249 'default' => ',',
250 'css' => 'width:12em;',
251 ],
252 [
253 'name' => __('Decimal Separator', 'give'),
254 'desc' => __('The symbol (usually , or .) to separate decimal points.', 'give'),
255 'id' => 'decimal_separator',
256 'type' => 'text',
257 'default' => '.',
258 'css' => 'width:12em;',
259 ],
260 [
261 'name' => __('Number of Decimals', 'give'),
262 'desc' => __('The number of decimal points displayed in amounts.', 'give'),
263 'id' => 'number_decimals',
264 'type' => 'text',
265 'default' => 2,
266 'css' => 'width:12em;',
267 ],
268 [
269 'name' => __('Currency Preview', 'give'),
270 'desc' => __(
271 'A preview of the formatted currency. This preview cannot be edited directly as it is generated from the settings above.',
272 'give'
273 ),
274 'id' => 'currency_preview',
275 'type' => 'give_currency_preview',
276 'default' => give_format_amount(
277 123456.12345,
278 [
279 'sanitize' => false,
280 'currency' => give_get_option('currency'),
281 ]
282 ),
283 'css' => 'width:12em;',
284 ],
285 [
286 'name' => __('Currency Options Docs Link', 'give'),
287 'id' => 'currency_settings_docs_link',
288 'url' => esc_url('http://docs.givewp.com/settings-currency'),
289 'title' => __('Currency Settings', 'give'),
290 'type' => 'give_docs_link',
291 ],
292 [
293 'type' => 'sectionend',
294 'id' => 'give_title_general_settings_2',
295 ],
296 ];
297
298 break;
299
300 case 'general-settings':
301 // Get default country code.
302 $countries = give_get_country();
303
304 // get the list of the states of which default country is selected.
305 $states = give_get_states($countries);
306
307 // Get the country list that does not have any states init.
308 $no_states_country = give_no_states_country_list();
309
310 $states_label = give_get_states_label();
311 $country = give_get_country();
312 $label = __('State', 'give');
313 // Check if $country code exists in the array key for states label.
314 if (array_key_exists($country, $states_label)) {
315 $label = $states_label[$country];
316 }
317
318 $settings = [
319 // Section 1: General.
320 [
321 'type' => 'title',
322 'id' => 'give_title_general_settings_1',
323 ],
324 [
325 'name' => __('General Settings', 'give'),
326 'desc' => '',
327 'type' => 'give_title',
328 'id' => 'give_title_general_settings_1',
329 ],
330 [
331 'name' => __('Success Page', 'give'),
332 /* translators: %s: [give_receipt] */
333 'desc' => sprintf(
334 __(
335 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.',
336 'give'
337 ),
338 '<code>[give_receipt]</code>'
339 ),
340 'id' => 'success_page',
341 'class' => 'give-select give-select-chosen',
342 'type' => 'select',
343 'options' => give_cmb2_get_post_options(
344 [
345 'post_type' => 'page',
346 'numberposts' => 30,
347 ]
348 ),
349 'attributes' => [
350 'data-search-type' => 'pages',
351 'data-placeholder' => esc_html__('Choose a page', 'give'),
352 ],
353 ],
354 [
355 'name' => __('Failed Donation Page', 'give'),
356 'desc' => __(
357 'The page donors are sent to if their donation is cancelled or fails.',
358 'give'
359 ),
360 'class' => 'give-select give-select-chosen',
361 'id' => 'failure_page',
362 'type' => 'select',
363 'options' => give_cmb2_get_post_options(
364 [
365 'post_type' => 'page',
366 'numberposts' => 30,
367 ]
368 ),
369 'attributes' => [
370 'data-search-type' => 'pages',
371 'data-placeholder' => esc_html__('Choose a page', 'give'),
372 ],
373 ],
374 [
375 'name' => __('Donation History Page', 'give'),
376 /* translators: %s: [donation_history] */
377 'desc' => sprintf(
378 __(
379 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.',
380 'give'
381 ),
382 '<code>[donation_history]</code>'
383 ),
384 'id' => 'history_page',
385 'class' => 'give-select give-select-chosen',
386 'type' => 'select',
387 'options' => give_cmb2_get_post_options(
388 [
389 'post_type' => 'page',
390 'numberposts' => 30,
391 ]
392 ),
393 'attributes' => [
394 'data-search-type' => 'pages',
395 'data-placeholder' => esc_html__('Choose a page', 'give'),
396 ],
397 ],
398 [
399 'name' => __('Base Country', 'give'),
400 'desc' => __('The country your site operates from.', 'give'),
401 'id' => 'base_country',
402 'type' => 'select',
403 'options' => give_get_country_list(),
404 'class' => 'give-select give-select-chosen',
405 'attributes' => [
406 'data-search-type' => 'no_ajax',
407 'data-placeholder' => esc_html__('Choose a country', 'give'),
408 ],
409 'default' => $country,
410 ],
411 /**
412 * Add base state to give setting
413 *
414 * @since 1.8.14
415 */
416 [
417 'wrapper_class' => (array_key_exists($countries, $no_states_country) ? 'give-hidden' : ''),
418 'name' => __('Base State/Province', 'give'),
419 'desc' => __('The state/province your site operates from.', 'give'),
420 'id' => 'base_state',
421 'type' => (empty($states) ? 'text' : 'select'),
422 'class' => (empty($states) ? '' : 'give-select give-select-chosen'),
423 'options' => $states,
424 'attributes' => [
425 'data-search-type' => 'no_ajax',
426 'data-placeholder' => $label,
427 ],
428 ],
429 [
430 'name' => __('General Options Docs Link', 'give'),
431 'id' => 'general_options_docs_link',
432 'url' => esc_url('http://docs.givewp.com/settings-general'),
433 'title' => __('General Options', 'give'),
434 'type' => 'give_docs_link',
435 ],
436 [
437 'type' => 'sectionend',
438 'id' => 'give_title_general_settings_1',
439 ],
440 ];
441 break;
442
443 case 'sequential-ordering':
444 $settings = [
445
446 // Section 4: Sequential Ordering
447
448 [
449 'id' => 'give_title_general_settings_4',
450 'type' => 'title',
451 ],
452 [
453 'name' => __('Sequential Ordering', 'give'),
454 'id' => "{$current_section}_status",
455 'desc' => __(
456 'Custom donation numbering that increases sequentially to prevent gaps between donation IDs. If disabled, then donation numbers are generated from WordPress post IDs, which will result in gaps between numbers.',
457 'give'
458 ),
459 'type' => 'radio_inline',
460 'default' => 'disabled',
461 'options' => [
462 'enabled' => __('Enabled', 'give'),
463 'disabled' => __('Disabled', 'give'),
464 ],
465 ],
466 [
467 'name' => __('Next Donation Number', 'give'),
468 'id' => "{$current_section}_number",
469 'desc' => sprintf(
470 __(
471 'The number used to generate the next donation ID. This value must be greater than or equal to %s to avoid conflicts with existing donation IDs.',
472 'give'
473 ),
474 '<code>' . Give()->seq_donation_number->get_next_number() . '</code>'
475 ),
476 'type' => 'number',
477 ],
478 [
479 'name' => __('Number Prefix', 'give'),
480 'id' => "{$current_section}_number_prefix",
481 'desc' => sprintf(
482 __(
483 'The prefix appended to all sequential donation numbers. Spaces are replaced by %s.',
484 'give'
485 ),
486 '<code>-</code>'
487 ),
488 'type' => 'text',
489 ],
490 [
491 'name' => __('Number Suffix', 'give'),
492 'id' => "{$current_section}_number_suffix",
493 'desc' => sprintf(
494 __(
495 'The suffix appended to all sequential donation numbers. Spaces are replaced by %s.',
496 'give'
497 ),
498 '<code>-</code>'
499 ),
500 'type' => 'text',
501 ],
502 [
503 'name' => __('Number Padding', 'give'),
504 'id' => "{$current_section}_number_padding",
505 'desc' => sprintf(
506 __(
507 'The minimum number of digits in the sequential donation number. Enter %1$s to display %2$s as %3$s.',
508 'give'
509 ),
510 '<code>4</code>',
511 '<code>1</code>',
512 '<code>0001</code>'
513 ),
514 'type' => 'number',
515 'default' => '0',
516 ],
517 [
518 'name' => __('Donation ID Preview', 'give'),
519 'id' => "{$current_section}_preview",
520 'type' => 'give_sequential_donation_code_preview',
521 'desc' => __(
522 'A preview of the next sequential donation ID. This preview cannot be edited directly as it is generated from the settings above.',
523 'give'
524 ),
525 ],
526 [
527 'name' => __('Sequential Ordering Docs Link', 'give'),
528 'id' => "{$current_section}_doc link",
529 'url' => esc_url('http://docs.givewp.com/settings-sequential-ordering'),
530 'title' => __('Sequential Ordering', 'give'),
531 'type' => 'give_docs_link',
532 ],
533 [
534 'id' => 'give_title_general_settings_4',
535 'type' => 'sectionend',
536 ],
537 ];
538 }
539
540 /**
541 * Filter the general settings.
542 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
543 */
544 $settings = apply_filters('give_settings_general', $settings);
545
546 /**
547 * Filter the settings.
548 *
549 * @since 1.8
550 *
551 * @param array $settings
552 */
553 $settings = apply_filters('give_get_settings_' . $this->id, $settings);
554
555 // Output.
556 return $settings;
557 }
558
559 /**
560 * Get sections.
561 *
562 * @since 1.8
563 * @return array
564 */
565 public function get_sections()
566 {
567 $sections = [
568 'general-settings' => __('General', 'give'),
569 'currency-settings' => __('Currency', 'give'),
570 'access-control' => __('Access Control', 'give'),
571 'sequential-ordering' => __('Sequential Ordering', 'give'),
572 ];
573
574 return apply_filters('give_get_sections_' . $this->id, $sections);
575 }
576
577 /**
578 * Set flag to reset sequestion donation number starting point when "Sequential Starting Number" value changes
579 *
580 * @since 2.1
581 * @access public
582 *
583 * @param $update_options
584 * @param $option_name
585 * @param $old_options
586 *
587 * @return bool
588 */
589 public function _give_change_donation_stating_number($update_options, $option_name, $old_options)
590 {
591 if (!isset($_POST['sequential-ordering_number'])) {
592 return false;
593 }
594
595 if (($next_number = Give()->seq_donation_number->get_next_number(
596 )) > $update_options['sequential-ordering_number']) {
597 give_update_option('sequential-ordering_number', $next_number);
598
599 Give_Admin_Settings::add_error(
600 'give-invalid-sequential-starting-number',
601 sprintf(
602 __(
603 'Next Donation Number must be equal to or larger than %s to avoid conflicts with existing donation IDs.',
604 'give'
605 ),
606 $next_number
607 )
608 );
609 } elseif ($update_options['sequential-ordering_number'] !== $old_options['sequential-ordering_number']) {
610 update_option('_give_reset_sequential_number', 1, false);
611 }
612
613 return true;
614 }
615
616 /**
617 * Render give_sequential_donation_code_preview field type
618 *
619 * @since 2.1.0
620 * @access public
621 *
622 * @param $field
623 */
624 public function _render_give_sequential_donation_code_preview($field)
625 {
626 ?>
627 <tr valign="top" <?php
628 echo !empty($field['wrapper_class']) ? 'class="' . $field['wrapper_class'] . '"' : ''; ?>>
629 <th scope="row" class="titledesc">
630 <label
631 for="<?php
632 echo esc_attr($field['id']); ?>"><?php
633 echo esc_html($field['name']); ?></label>
634 </th>
635 <td class="give-forminp">
636 <input id="<?php
637 echo esc_attr($field['id']); ?>" class="give-input-field" type="text" disabled>
638 <?php
639 echo Give_Admin_Settings::get_field_description($field); ?>
640 </td>
641 </tr>
642 <?php
643 }
644
645 /**
646 * Render give_currency_code_preview field type
647 *
648 * @since 2.3.0
649 * @access public
650 *
651 * @param array $field Field Attributes array.
652 *
653 * @return void
654 */
655 public function _render_give_currency_preview($field, $value)
656 {
657 $currency = give_get_currency();
658 $currency_position = give_get_currency_position();
659 $currency_symbol = give_currency_symbol($currency, false);
660 $formatted_currency = ('before' === $currency_position)
661 ? sprintf('%1$s%2$s', esc_html($currency_symbol), esc_html($field['default']))
662 : sprintf('%1$s%2$s', esc_html($field['default']), esc_html($currency_symbol));
663 ?>
664 <tr valign="top" <?php
665 echo !empty($field['wrapper_class']) ? 'class="' . $field['wrapper_class'] . '"' : ''; ?>>
666 <th scope="row" class="titledesc">
667 <label
668 for="<?php
669 echo esc_attr($field['id']); ?>"><?php
670 echo wp_kses_post($field['name']); ?></label>
671 </th>
672 <td class="give-forminp">
673 <input id="<?php
674 echo esc_attr($field['id']); ?>" class="give-input-field" type="text" disabled value="<?php
675 echo esc_attr($formatted_currency); ?>">
676 <?php
677 echo Give_Admin_Settings::get_field_description($field); ?>
678 </td>
679 </tr>
680 <?php
681 }
682
683 /**
684 * Render give_unlock_all_settings field type
685 *
686 * @since 2.1.0
687 * @access public
688 *
689 * @param $field
690 */
691 public function _render_give_unlock_all_settings($field)
692 {
693 ?>
694 <tr valign="top" <?php
695 echo !empty($field['wrapper_class']) ? 'class="' . $field['wrapper_class'] . '"' : ''; ?>>
696 <th scope="row" class="titledesc">
697 <label
698 for="<?php
699 echo esc_attr($field['id']); ?>"><?php
700 echo esc_html($field['name']); ?></label>
701 </th>
702 <td class="give-forminp">
703 <?php
704 echo Give_Admin_Settings::get_field_description($field); ?>
705 <a href="" id="<?php
706 echo $field['id']; ?>" data-message="<?php
707 echo $field['confirmation_msg']; ?>"><?php
708 echo __('Unlock all settings', 'give'); ?></a>
709 </td>
710 </tr>
711 <?php
712 }
713 }
714
715 endif;
716
717 return new Give_Settings_General();
718