PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.7.4
GiveWP – Donation Plugin and Fundraising Platform v2.7.4
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 6 years ago class-settings-display.php 5 years ago class-settings-email.php 6 years ago class-settings-gateways.php 6 years ago class-settings-general.php 6 years ago class-settings-license.php 6 years ago
class-settings-general.php
593 lines
1 <?php
2 /**
3 * Give Settings Page/Tab
4 *
5 * @package Give
6 * @subpackage Classes/Give_Settings_General
7 * @copyright Copyright (c) 2016, GiveWP
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.8
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 * Constructor.
27 */
28 public function __construct() {
29 $this->id = 'general';
30 $this->label = __( 'General', 'give' );
31
32 $this->default_tab = 'general-settings';
33
34 if ( $this->id === give_get_current_setting_tab() ) {
35 add_action( 'give_save_settings_give_settings', array( $this, '_give_change_donation_stating_number' ), 10, 3 );
36 add_action( 'give_admin_field_give_sequential_donation_code_preview', array( $this, '_render_give_sequential_donation_code_preview' ), 10, 3 );
37 add_action( 'give_admin_field_give_currency_preview', array( $this, '_render_give_currency_preview' ), 10, 2 );
38 add_action( 'give_admin_field_give_unlock_all_settings', array( $this, '_render_give_unlock_all_settings' ), 10, 3 );
39 }
40
41 parent::__construct();
42 }
43
44 /**
45 * Get settings array.
46 *
47 * @since 1.8
48 * @return array
49 */
50 public function get_settings() {
51 $settings = array();
52 $current_section = give_get_current_setting_section();
53
54 switch ( $current_section ) {
55 case 'access-control':
56 $settings = array(
57 // Section 3: Access control.
58 array(
59 'id' => 'give_title_session_control_1',
60 'type' => 'title',
61 ),
62 array(
63 'id' => 'session_lifetime',
64 'name' => __( 'Session Lifetime', 'give' ),
65 'desc' => __( '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.', 'give' ),
66 'type' => 'select',
67 'options' => array(
68 '86400' => __( '24 Hours', 'give' ),
69 '172800' => __( '48 Hours', 'give' ),
70 '259200' => __( '72 Hours', 'give' ),
71 '604800' => __( '1 Week', 'give' ),
72 ),
73 ),
74 array(
75 'id' => 'limit_display_donations',
76 'name' => __( 'Limit Donations Displayed', 'give' ),
77 'desc' => __( '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.', 'give' ),
78 'default' => '1',
79 'type' => 'number',
80 'css' => 'width:50px;',
81 'attributes' => array(
82 'min' => '1',
83 'max' => '10',
84 ),
85 ),
86 array(
87 'name' => __( 'Email Access', 'give' ),
88 'desc' => __( '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.', 'give' ),
89 'id' => 'email_access',
90 'type' => 'radio_inline',
91 'default' => 'disabled',
92 'options' => array(
93 'enabled' => __( 'Enabled', 'give' ),
94 'disabled' => __( 'Disabled', 'give' ),
95 ),
96 ),
97 array(
98 'name' => __( 'Enable reCAPTCHA', 'give' ),
99 'desc' => __( 'If enabled, this option adds a reCAPTCHA field to the email access form. Note: this does not add reCAPTCHA to donation forms.', 'give' ),
100 'id' => 'enable_recaptcha',
101 'type' => 'radio_inline',
102 'default' => 'disabled',
103 'options' => array(
104 'enabled' => __( 'Enabled', 'give' ),
105 'disabled' => __( 'Disabled', 'give' ),
106 ),
107 ),
108 array(
109 'id' => 'recaptcha_key',
110 'name' => __( 'reCAPTCHA Site Key', 'give' ),
111 /* translators: %s: https://www.google.com/recaptcha/ */
112 'desc' => sprintf( __( '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.', 'give' ), esc_url( 'http://docs.givewp.com/recaptcha' ) ),
113 'default' => '',
114 'type' => 'text',
115 ),
116 array(
117 'id' => 'recaptcha_secret',
118 'name' => __( 'reCAPTCHA Secret Key', 'give' ),
119 'desc' => __( 'Please paste the reCAPTCHA secret key here from your reCAPTCHA API Keys panel.', 'give' ),
120 'default' => '',
121 'type' => 'text',
122 ),
123 array(
124 'name' => __( 'Access Control Docs Link', 'give' ),
125 'id' => 'access_control_docs_link',
126 'url' => esc_url( 'http://docs.givewp.com/settings-access-control' ),
127 'title' => __( 'Access Control', 'give' ),
128 'type' => 'give_docs_link',
129 ),
130 array(
131 'id' => 'give_title_session_control_1',
132 'type' => 'sectionend',
133 ),
134 );
135 break;
136
137 case 'currency-settings':
138 $currency_position_before = __( 'Before - %s&#x200e;10', 'give' );
139 $currency_position_after = __( 'After - 10%s&#x200f;', 'give' );
140
141 $settings = array(
142 // Section 2: Currency
143 array(
144 'type' => 'title',
145 'id' => 'give_title_general_settings_2',
146 ),
147 array(
148 'name' => __( 'Currency Settings', 'give' ),
149 'desc' => '',
150 'type' => 'give_title',
151 'id' => 'give_title_general_settings_2',
152 ),
153 array(
154 'name' => __( 'Currency', 'give' ),
155 'desc' => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
156 'id' => 'currency',
157 'class' => 'give-select-chosen',
158 'type' => 'select',
159 'options' => give_get_currencies(),
160 'default' => 'USD',
161 'attributes' => array(
162 'data-formatting-setting' => esc_js( wp_json_encode( give_get_currencies_list() ) ),
163 ),
164 ),
165 array(
166 'name' => __( 'Currency Position', 'give' ),
167 'desc' => __( 'The position of the currency symbol.', 'give' ),
168 'id' => 'currency_position',
169 'type' => 'select',
170 'options' => array(
171 /* translators: %s: currency symbol */
172 'before' => sprintf( $currency_position_before, give_currency_symbol( give_get_currency() ) ),
173 /* translators: %s: currency symbol */
174 'after' => sprintf( $currency_position_after, give_currency_symbol( give_get_currency() ) ),
175 ),
176 'default' => 'before',
177 'attributes' => array(
178 'data-before-template' => sprintf( $currency_position_before, '{currency_pos}' ),
179 'data-after-template' => sprintf( $currency_position_after, '{currency_pos}' ),
180 ),
181 ),
182 array(
183 'name' => __( 'Thousands Separator', 'give' ),
184 'desc' => __( 'The symbol (typically , or .) to separate thousands.', 'give' ),
185 'id' => 'thousands_separator',
186 'type' => 'text',
187 'default' => ',',
188 'css' => 'width:12em;',
189 ),
190 array(
191 'name' => __( 'Decimal Separator', 'give' ),
192 'desc' => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
193 'id' => 'decimal_separator',
194 'type' => 'text',
195 'default' => '.',
196 'css' => 'width:12em;',
197 ),
198 array(
199 'name' => __( 'Number of Decimals', 'give' ),
200 'desc' => __( 'The number of decimal points displayed in amounts.', 'give' ),
201 'id' => 'number_decimals',
202 'type' => 'text',
203 'default' => 2,
204 'css' => 'width:12em;',
205 ),
206 array(
207 'name' => __( 'Currency Preview', 'give' ),
208 'desc' => __( 'A preview of the formatted currency. This preview cannot be edited directly as it is generated from the settings above.', 'give' ),
209 'id' => 'currency_preview',
210 'type' => 'give_currency_preview',
211 'default' => give_format_amount(
212 123456.12345,
213 array(
214 'sanitize' => false,
215 'currency' => give_get_option( 'currency' ),
216 )
217 ),
218 'css' => 'width:12em;',
219 ),
220 array(
221 'name' => __( 'Currency Options Docs Link', 'give' ),
222 'id' => 'currency_settings_docs_link',
223 'url' => esc_url( 'http://docs.givewp.com/settings-currency' ),
224 'title' => __( 'Currency Settings', 'give' ),
225 'type' => 'give_docs_link',
226 ),
227 array(
228 'type' => 'sectionend',
229 'id' => 'give_title_general_settings_2',
230 ),
231 );
232
233 break;
234
235 case 'general-settings':
236 // Get default country code.
237 $countries = give_get_country();
238
239 // get the list of the states of which default country is selected.
240 $states = give_get_states( $countries );
241
242 // Get the country list that does not have any states init.
243 $no_states_country = give_no_states_country_list();
244
245 $states_label = give_get_states_label();
246 $country = give_get_country();
247 $label = __( 'State', 'give' );
248 // Check if $country code exists in the array key for states label.
249 if ( array_key_exists( $country, $states_label ) ) {
250 $label = $states_label[ $country ];
251 }
252
253 $settings = array(
254 // Section 1: General.
255 array(
256 'type' => 'title',
257 'id' => 'give_title_general_settings_1',
258 ),
259 array(
260 'name' => __( 'General Settings', 'give' ),
261 'desc' => '',
262 'type' => 'give_title',
263 'id' => 'give_title_general_settings_1',
264 ),
265 array(
266 'name' => __( 'Success Page', 'give' ),
267 /* translators: %s: [give_receipt] */
268 'desc' => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
269 'id' => 'success_page',
270 'class' => 'give-select give-select-chosen',
271 'type' => 'select',
272 'options' => give_cmb2_get_post_options(
273 array(
274 'post_type' => 'page',
275 'numberposts' => 30,
276 )
277 ),
278 'attributes' => array(
279 'data-search-type' => 'pages',
280 'data-placeholder' => esc_html__( 'Choose a page', 'give' ),
281 ),
282 ),
283 array(
284 'name' => __( 'Failed Donation Page', 'give' ),
285 'desc' => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
286 'class' => 'give-select give-select-chosen',
287 'id' => 'failure_page',
288 'type' => 'select',
289 'options' => give_cmb2_get_post_options(
290 array(
291 'post_type' => 'page',
292 'numberposts' => 30,
293 )
294 ),
295 'attributes' => array(
296 'data-search-type' => 'pages',
297 'data-placeholder' => esc_html__( 'Choose a page', 'give' ),
298 ),
299 ),
300 array(
301 'name' => __( 'Donation History Page', 'give' ),
302 /* translators: %s: [donation_history] */
303 'desc' => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
304 'id' => 'history_page',
305 'class' => 'give-select give-select-chosen',
306 'type' => 'select',
307 'options' => give_cmb2_get_post_options(
308 array(
309 'post_type' => 'page',
310 'numberposts' => 30,
311 )
312 ),
313 'attributes' => array(
314 'data-search-type' => 'pages',
315 'data-placeholder' => esc_html__( 'Choose a page', 'give' ),
316 ),
317 ),
318 array(
319 'name' => __( 'Base Country', 'give' ),
320 'desc' => __( 'The country your site operates from.', 'give' ),
321 'id' => 'base_country',
322 'type' => 'select',
323 'options' => give_get_country_list(),
324 'class' => 'give-select give-select-chosen',
325 'attributes' => array(
326 'data-search-type' => 'no_ajax',
327 ),
328 'default' => $country,
329 ),
330 /**
331 * Add base state to give setting
332 *
333 * @since 1.8.14
334 */
335 array(
336 'wrapper_class' => ( array_key_exists( $countries, $no_states_country ) ? 'give-hidden' : '' ),
337 'name' => __( 'Base State/Province', 'give' ),
338 'desc' => __( 'The state/province your site operates from.', 'give' ),
339 'id' => 'base_state',
340 'type' => ( empty( $states ) ? 'text' : 'select' ),
341 'class' => ( empty( $states ) ? '' : 'give-select give-select-chosen' ),
342 'options' => $states,
343 'attributes' => array(
344 'data-search-type' => 'no_ajax',
345 'data-placeholder' => $label,
346 ),
347 ),
348 array(
349 'name' => __( 'General Options Docs Link', 'give' ),
350 'id' => 'general_options_docs_link',
351 'url' => esc_url( 'http://docs.givewp.com/settings-general' ),
352 'title' => __( 'General Options', 'give' ),
353 'type' => 'give_docs_link',
354 ),
355 array(
356 'type' => 'sectionend',
357 'id' => 'give_title_general_settings_1',
358 ),
359 );
360 break;
361
362 case 'sequential-ordering':
363 $settings = array(
364
365 // Section 4: Sequential Ordering
366
367 array(
368 'id' => 'give_title_general_settings_4',
369 'type' => 'title',
370 ),
371 array(
372 'name' => __( 'Sequential Ordering', 'give' ),
373 'id' => "{$current_section}_status",
374 'desc' => __( '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.', 'give' ),
375 'type' => 'radio_inline',
376 'default' => 'disabled',
377 'options' => array(
378 'enabled' => __( 'Enabled', 'give' ),
379 'disabled' => __( 'Disabled', 'give' ),
380 ),
381 ),
382 array(
383 'name' => __( 'Next Donation Number', 'give' ),
384 'id' => "{$current_section}_number",
385 'desc' => sprintf(
386 __( '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.', 'give' ),
387 '<code>' . Give()->seq_donation_number->get_next_number() . '</code>'
388 ),
389 'type' => 'number',
390 ),
391 array(
392 'name' => __( 'Number Prefix', 'give' ),
393 'id' => "{$current_section}_number_prefix",
394 'desc' => sprintf(
395 __( 'The prefix appended to all sequential donation numbers. Spaces are replaced by %s.', 'give' ),
396 '<code>-</code>'
397 ),
398 'type' => 'text',
399 ),
400 array(
401 'name' => __( 'Number Suffix', 'give' ),
402 'id' => "{$current_section}_number_suffix",
403 'desc' => sprintf(
404 __( 'The suffix appended to all sequential donation numbers. Spaces are replaced by %s.', 'give' ),
405 '<code>-</code>'
406 ),
407 'type' => 'text',
408 ),
409 array(
410 'name' => __( 'Number Padding', 'give' ),
411 'id' => "{$current_section}_number_padding",
412 'desc' => sprintf(
413 __( 'The minimum number of digits in the sequential donation number. Enter %1$s to display %2$s as %3$s.', 'give' ),
414 '<code>4</code>',
415 '<code>1</code>',
416 '<code>0001</code>'
417 ),
418 'type' => 'number',
419 'default' => '0',
420 ),
421 array(
422 'name' => __( 'Donation ID Preview', 'give' ),
423 'id' => "{$current_section}_preview",
424 'type' => 'give_sequential_donation_code_preview',
425 'desc' => __( 'A preview of the next sequential donation ID. This preview cannot be edited directly as it is generated from the settings above.', 'give' ),
426 ),
427 array(
428 'name' => __( 'Sequential Ordering Docs Link', 'give' ),
429 'id' => "{$current_section}_doc link",
430 'url' => esc_url( 'http://docs.givewp.com/settings-sequential-ordering' ),
431 'title' => __( 'Sequential Ordering', 'give' ),
432 'type' => 'give_docs_link',
433 ),
434 array(
435 'id' => 'give_title_general_settings_4',
436 'type' => 'sectionend',
437 ),
438 );
439 }
440
441 /**
442 * Filter the general settings.
443 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
444 */
445 $settings = apply_filters( 'give_settings_general', $settings );
446
447 /**
448 * Filter the settings.
449 *
450 * @since 1.8
451 *
452 * @param array $settings
453 */
454 $settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
455
456 // Output.
457 return $settings;
458 }
459
460 /**
461 * Get sections.
462 *
463 * @since 1.8
464 * @return array
465 */
466 public function get_sections() {
467 $sections = array(
468 'general-settings' => __( 'General', 'give' ),
469 'currency-settings' => __( 'Currency', 'give' ),
470 'access-control' => __( 'Access Control', 'give' ),
471 'sequential-ordering' => __( 'Sequential Ordering', 'give' ),
472 );
473
474 return apply_filters( 'give_get_sections_' . $this->id, $sections );
475 }
476
477
478 /**
479 * Set flag to reset sequestion donation number starting point when "Sequential Starting Number" value changes
480 *
481 * @since 2.1
482 * @access public
483 *
484 * @param $update_options
485 * @param $option_name
486 * @param $old_options
487 *
488 * @return bool
489 */
490 public function _give_change_donation_stating_number( $update_options, $option_name, $old_options ) {
491 if ( ! isset( $_POST['sequential-ordering_number'] ) ) {
492 return false;
493 }
494
495 if ( ( $next_number = Give()->seq_donation_number->get_next_number() ) > $update_options['sequential-ordering_number'] ) {
496 give_update_option( 'sequential-ordering_number', $next_number );
497
498 Give_Admin_Settings::add_error(
499 'give-invalid-sequential-starting-number',
500 sprintf(
501 __( 'Next Donation Number must be equal to or larger than %s to avoid conflicts with existing donation IDs.', 'give' ),
502 $next_number
503 )
504 );
505 } elseif ( $update_options['sequential-ordering_number'] !== $old_options['sequential-ordering_number'] ) {
506 update_option( '_give_reset_sequential_number', 1, false );
507 }
508
509 return true;
510 }
511
512 /**
513 * Render give_sequential_donation_code_preview field type
514 *
515 * @since 2.1.0
516 * @access public
517 *
518 * @param $field
519 */
520 public function _render_give_sequential_donation_code_preview( $field ) {
521 ?>
522 <tr valign="top" <?php echo ! empty( $field['wrapper_class'] ) ? 'class="' . $field['wrapper_class'] . '"' : ''; ?>>
523 <th scope="row" class="titledesc">
524 <label
525 for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['name'] ); ?></label>
526 </th>
527 <td class="give-forminp">
528 <input id="<?php echo esc_attr( $field['id'] ); ?>" class="give-input-field" type="text" disabled>
529 <?php echo Give_Admin_Settings::get_field_description( $field ); ?>
530 </td>
531 </tr>
532 <?php
533 }
534
535 /**
536 * Render give_currency_code_preview field type
537 *
538 * @since 2.3.0
539 * @access public
540 *
541 * @param array $field Field Attributes array.
542 *
543 * @return void
544 */
545 public function _render_give_currency_preview( $field, $value ) {
546 $currency = give_get_currency();
547 $currency_position = give_get_currency_position();
548 $currency_symbol = give_currency_symbol( $currency, false );
549 $formatted_currency = ( 'before' === $currency_position )
550 ? sprintf( '%1$s%2$s', esc_html( $currency_symbol ), esc_html( $field['default'] ) )
551 : sprintf( '%1$s%2$s', esc_html( $field['default'] ), esc_html( $currency_symbol ) );
552 ?>
553 <tr valign="top" <?php echo ! empty( $field['wrapper_class'] ) ? 'class="' . $field['wrapper_class'] . '"' : ''; ?>>
554 <th scope="row" class="titledesc">
555 <label
556 for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['name'] ); ?></label>
557 </th>
558 <td class="give-forminp">
559 <input id="<?php echo esc_attr( $field['id'] ); ?>" class="give-input-field" type="text" disabled value="<?php echo esc_attr( $formatted_currency ); ?>">
560 <?php echo Give_Admin_Settings::get_field_description( $field ); ?>
561 </td>
562 </tr>
563 <?php
564 }
565
566 /**
567 * Render give_unlock_all_settings field type
568 *
569 * @since 2.1.0
570 * @access public
571 *
572 * @param $field
573 */
574 public function _render_give_unlock_all_settings( $field ) {
575 ?>
576 <tr valign="top" <?php echo ! empty( $field['wrapper_class'] ) ? 'class="' . $field['wrapper_class'] . '"' : ''; ?>>
577 <th scope="row" class="titledesc">
578 <label
579 for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['name'] ); ?></label>
580 </th>
581 <td class="give-forminp">
582 <?php echo Give_Admin_Settings::get_field_description( $field ); ?>
583 <a href="" id="<?php echo $field['id']; ?>" data-message="<?php echo $field['confirmation_msg']; ?>"><?php echo __( 'Unlock all settings', 'give' ); ?></a>
584 </td>
585 </tr>
586 <?php
587 }
588 }
589
590 endif;
591
592 return new Give_Settings_General();
593