Test Failed
Pull Request — master (#2038)
by
unknown
05:33
created
includes/admin/admin-actions.php 1 patch
Spacing   +110 added lines, -111 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -20,19 +20,19 @@  discard block
 block discarded – undo
20 20
  * @since 1.8
21 21
  */
22 22
 function give_load_wp_editor() {
23
-	if ( ! isset( $_POST['wp_editor'] ) ) {
23
+	if ( ! isset($_POST['wp_editor'])) {
24 24
 		die();
25 25
 	}
26 26
 
27
-	$wp_editor                     = json_decode( base64_decode( $_POST['wp_editor'] ), true );
27
+	$wp_editor                     = json_decode(base64_decode($_POST['wp_editor']), true);
28 28
 	$wp_editor[2]['textarea_name'] = $_POST['textarea_name'];
29 29
 
30
-	wp_editor( $wp_editor[0], $_POST['wp_editor_id'], $wp_editor[2] );
30
+	wp_editor($wp_editor[0], $_POST['wp_editor_id'], $wp_editor[2]);
31 31
 
32 32
 	die();
33 33
 }
34 34
 
35
-add_action( 'wp_ajax_give_load_wp_editor', 'give_load_wp_editor' );
35
+add_action('wp_ajax_give_load_wp_editor', 'give_load_wp_editor');
36 36
 
37 37
 
38 38
 /**
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
 	);
53 53
 
54 54
 	// Get current page.
55
-	$current_page = isset( $_GET['page'] ) ? esc_attr( $_GET['page'] ) : '';
55
+	$current_page = isset($_GET['page']) ? esc_attr($_GET['page']) : '';
56 56
 
57 57
 	// Bailout.
58 58
 	if (
59
-		empty( $current_page )
60
-		|| empty( $_GET['_wp_http_referer'] )
61
-		|| ! in_array( $current_page, $give_pages )
59
+		empty($current_page)
60
+		|| empty($_GET['_wp_http_referer'])
61
+		|| ! in_array($current_page, $give_pages)
62 62
 	) {
63 63
 		return false;
64 64
 	}
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @since 1.8
70 70
 	 */
71
-	$redirect = apply_filters( "give_validate_{$current_page}", true );
71
+	$redirect = apply_filters("give_validate_{$current_page}", true);
72 72
 
73
-	if ( $redirect ) {
73
+	if ($redirect) {
74 74
 		// Redirect.
75 75
 		wp_redirect(
76 76
 			remove_query_arg(
77
-				array( '_wp_http_referer', '_wpnonce' ),
78
-				wp_unslash( $_SERVER['REQUEST_URI'] )
77
+				array('_wp_http_referer', '_wpnonce'),
78
+				wp_unslash($_SERVER['REQUEST_URI'])
79 79
 			)
80 80
 		);
81 81
 		exit;
82 82
 	}
83 83
 }
84 84
 
85
-add_action( 'admin_init', 'give_redirect_to_clean_url_admin_pages' );
85
+add_action('admin_init', 'give_redirect_to_clean_url_admin_pages');
86 86
 
87 87
 
88 88
 /**
@@ -96,25 +96,25 @@  discard block
 block discarded – undo
96 96
  */
97 97
 function give_hide_outdated_php_notice() {
98 98
 
99
-	if ( ! isset( $_POST['_give_hide_outdated_php_notices_shortly'] ) ) {
99
+	if ( ! isset($_POST['_give_hide_outdated_php_notices_shortly'])) {
100 100
 		give_die();
101 101
 	}
102 102
 
103 103
 	// Transient key name.
104 104
 	$transient_key = "_give_hide_outdated_php_notices_shortly";
105 105
 
106
-	if ( Give_Cache::get( $transient_key, true ) ) {
106
+	if (Give_Cache::get($transient_key, true)) {
107 107
 		return;
108 108
 	}
109 109
 
110 110
 	// Hide notice for 24 hours.
111
-	Give_Cache::set( $transient_key, true, DAY_IN_SECONDS, true );
111
+	Give_Cache::set($transient_key, true, DAY_IN_SECONDS, true);
112 112
 
113 113
 	give_die();
114 114
 
115 115
 }
116 116
 
117
-add_action( 'wp_ajax_give_hide_outdated_php_notice', 'give_hide_outdated_php_notice' );
117
+add_action('wp_ajax_give_hide_outdated_php_notice', 'give_hide_outdated_php_notice');
118 118
 
119 119
 /**
120 120
  * Updates state list.
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
  * @return void
125 125
  */
126 126
 function give_update_states() {
127
-	$country_code = filter_input( INPUT_POST, 'country_code', FILTER_SANITIZE_STRING );
127
+	$country_code = filter_input(INPUT_POST, 'country_code', FILTER_SANITIZE_STRING);
128 128
 	$states_list  = give_states_list();
129
-	echo wp_json_encode( $states_list[ $country_code ] );
129
+	echo wp_json_encode($states_list[$country_code]);
130 130
 	wp_die();
131 131
 }
132
-add_action( 'wp_ajax_give_update_states', 'give_update_states' );
132
+add_action('wp_ajax_give_update_states', 'give_update_states');
133 133
 
134 134
 /**
135 135
  * Register admin notices.
@@ -138,23 +138,23 @@  discard block
 block discarded – undo
138 138
  */
139 139
 function _give_register_admin_notices() {
140 140
 	// Bailout.
141
-	if( ! is_admin() ) {
141
+	if ( ! is_admin()) {
142 142
 		return;
143 143
 	}
144 144
 
145 145
 	// Add payment bulk notice.
146 146
 	if (
147
-		current_user_can( 'edit_give_payments' )
148
-		&& isset( $_GET['action'] )
149
-		&& ! empty( $_GET['action'] )
150
-		&& isset( $_GET['payment'] )
151
-		&& ! empty( $_GET['payment'] )
147
+		current_user_can('edit_give_payments')
148
+		&& isset($_GET['action'])
149
+		&& ! empty($_GET['action'])
150
+		&& isset($_GET['payment'])
151
+		&& ! empty($_GET['payment'])
152 152
 	) {
153
-		$payment_count = isset( $_GET['payment'] ) ? count( $_GET['payment'] ) : 0;
153
+		$payment_count = isset($_GET['payment']) ? count($_GET['payment']) : 0;
154 154
 
155
-		switch ( $_GET['action'] ) {
155
+		switch ($_GET['action']) {
156 156
 			case 'delete':
157
-				Give()->notices->register_notice( array(
157
+				Give()->notices->register_notice(array(
158 158
 					'id'          => 'bulk_action_delete',
159 159
 					'type'        => 'updated',
160 160
 					'description' => sprintf(
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 						),
167 167
 						$payment_count ),
168 168
 					'show'        => true,
169
-				) );
169
+				));
170 170
 
171 171
 				break;
172 172
 
173 173
 			case 'resend-receipt':
174
-				Give()->notices->register_notice( array(
174
+				Give()->notices->register_notice(array(
175 175
 					'id'          => 'bulk_action_resend_receipt',
176 176
 					'type'        => 'updated',
177 177
 					'description' => sprintf(
@@ -184,196 +184,196 @@  discard block
 block discarded – undo
184 184
 						$payment_count
185 185
 					),
186 186
 					'show'        => true,
187
-				) );
187
+				));
188 188
 				break;
189 189
 		}
190 190
 	}
191 191
 
192 192
 	// Add give message notices.
193
-	if ( ! empty( $_GET['give-message'] ) ) {
193
+	if ( ! empty($_GET['give-message'])) {
194 194
 		// Donation reports errors.
195
-		if ( current_user_can( 'view_give_reports' ) ) {
196
-			switch ( $_GET['give-message'] ) {
195
+		if (current_user_can('view_give_reports')) {
196
+			switch ($_GET['give-message']) {
197 197
 				case 'donation_deleted' :
198
-					Give()->notices->register_notice( array(
198
+					Give()->notices->register_notice(array(
199 199
 						'id'          => 'give-donation-deleted',
200 200
 						'type'        => 'updated',
201
-						'description' => __( 'The donation has been deleted.', 'give' ),
201
+						'description' => __('The donation has been deleted.', 'give'),
202 202
 						'show'        => true,
203
-					) );
203
+					));
204 204
 					break;
205 205
 				case 'email_sent' :
206
-					Give()->notices->register_notice( array(
206
+					Give()->notices->register_notice(array(
207 207
 						'id'          => 'give-payment-sent',
208 208
 						'type'        => 'updated',
209
-						'description' => __( 'The donation receipt has been resent.', 'give' ),
209
+						'description' => __('The donation receipt has been resent.', 'give'),
210 210
 						'show'        => true,
211
-					) );
211
+					));
212 212
 					break;
213 213
 				case 'refreshed-reports' :
214
-					Give()->notices->register_notice( array(
214
+					Give()->notices->register_notice(array(
215 215
 						'id'          => 'give-refreshed-reports',
216 216
 						'type'        => 'updated',
217
-						'description' => __( 'The reports cache has been cleared.', 'give' ),
217
+						'description' => __('The reports cache has been cleared.', 'give'),
218 218
 						'show'        => true,
219
-					) );
219
+					));
220 220
 					break;
221 221
 				case 'donation-note-deleted' :
222
-					Give()->notices->register_notice( array(
222
+					Give()->notices->register_notice(array(
223 223
 						'id'          => 'give-donation-note-deleted',
224 224
 						'type'        => 'updated',
225
-						'description' => __( 'The donation note has been deleted.', 'give' ),
225
+						'description' => __('The donation note has been deleted.', 'give'),
226 226
 						'show'        => true,
227
-					) );
227
+					));
228 228
 					break;
229 229
 			}
230 230
 		}
231 231
 
232 232
 		// Give settings notices and errors.
233
-		if ( current_user_can( 'manage_give_settings' ) ) {
234
-			switch ( $_GET['give-message'] ) {
233
+		if (current_user_can('manage_give_settings')) {
234
+			switch ($_GET['give-message']) {
235 235
 				case 'settings-imported' :
236
-					Give()->notices->register_notice( array(
236
+					Give()->notices->register_notice(array(
237 237
 						'id'          => 'give-settings-imported',
238 238
 						'type'        => 'updated',
239
-						'description' => __( 'The settings have been imported.', 'give' ),
239
+						'description' => __('The settings have been imported.', 'give'),
240 240
 						'show'        => true,
241
-					) );
241
+					));
242 242
 					break;
243 243
 				case 'api-key-generated' :
244
-					Give()->notices->register_notice( array(
244
+					Give()->notices->register_notice(array(
245 245
 						'id'          => 'give-api-key-generated',
246 246
 						'type'        => 'updated',
247
-						'description' => __( 'API keys have been generated.', 'give' ),
247
+						'description' => __('API keys have been generated.', 'give'),
248 248
 						'show'        => true,
249
-					) );
249
+					));
250 250
 					break;
251 251
 				case 'api-key-exists' :
252
-					Give()->notices->register_notice( array(
252
+					Give()->notices->register_notice(array(
253 253
 						'id'          => 'give-api-key-exists',
254 254
 						'type'        => 'updated',
255
-						'description' => __( 'The specified user already has API keys.', 'give' ),
255
+						'description' => __('The specified user already has API keys.', 'give'),
256 256
 						'show'        => true,
257
-					) );
257
+					));
258 258
 					break;
259 259
 				case 'api-key-regenerated' :
260
-					Give()->notices->register_notice( array(
260
+					Give()->notices->register_notice(array(
261 261
 						'id'          => 'give-api-key-regenerated',
262 262
 						'type'        => 'updated',
263
-						'description' => __( 'API keys have been regenerated.', 'give' ),
263
+						'description' => __('API keys have been regenerated.', 'give'),
264 264
 						'show'        => true,
265
-					) );
265
+					));
266 266
 					break;
267 267
 				case 'api-key-revoked' :
268
-					Give()->notices->register_notice( array(
268
+					Give()->notices->register_notice(array(
269 269
 						'id'          => 'give-api-key-revoked',
270 270
 						'type'        => 'updated',
271
-						'description' => __( 'API keys have been revoked.', 'give' ),
271
+						'description' => __('API keys have been revoked.', 'give'),
272 272
 						'show'        => true,
273
-					) );
273
+					));
274 274
 					break;
275 275
 				case 'sent-test-email' :
276
-					Give()->notices->register_notice( array(
276
+					Give()->notices->register_notice(array(
277 277
 						'id'          => 'give-sent-test-email',
278 278
 						'type'        => 'updated',
279
-						'description' => __( 'The test email has been sent.', 'give' ),
279
+						'description' => __('The test email has been sent.', 'give'),
280 280
 						'show'        => true,
281
-					) );
281
+					));
282 282
 					break;
283 283
 				case 'matched-success-failure-page':
284
-					Give()->notices->register_notice( array(
284
+					Give()->notices->register_notice(array(
285 285
 						'id'          => 'give-matched-success-failure-page',
286 286
 						'type'        => 'updated',
287
-						'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ),
287
+						'description' => __('You cannot set the success and failed pages to the same page', 'give'),
288 288
 						'show'        => true,
289
-					) );
289
+					));
290 290
 					break;
291 291
 			}
292 292
 		}
293 293
 		// Payments errors.
294
-		if ( current_user_can( 'edit_give_payments' ) ) {
295
-			switch ( $_GET['give-message'] ) {
294
+		if (current_user_can('edit_give_payments')) {
295
+			switch ($_GET['give-message']) {
296 296
 				case 'note-added' :
297
-					Give()->notices->register_notice( array(
297
+					Give()->notices->register_notice(array(
298 298
 						'id'          => 'give-note-added',
299 299
 						'type'        => 'updated',
300
-						'description' => __( 'The donation note has been added.', 'give' ),
300
+						'description' => __('The donation note has been added.', 'give'),
301 301
 						'show'        => true,
302
-					) );
302
+					));
303 303
 					break;
304 304
 				case 'payment-updated' :
305
-					Give()->notices->register_notice( array(
305
+					Give()->notices->register_notice(array(
306 306
 						'id'          => 'give-payment-updated',
307 307
 						'type'        => 'updated',
308
-						'description' => __( 'The donation has been updated.', 'give' ),
308
+						'description' => __('The donation has been updated.', 'give'),
309 309
 						'show'        => true,
310
-					) );
310
+					));
311 311
 					break;
312 312
 			}
313 313
 		}
314 314
 
315 315
 		// Donor Notices.
316
-		if ( current_user_can( 'edit_give_payments' ) ) {
317
-			switch ( $_GET['give-message'] ) {
316
+		if (current_user_can('edit_give_payments')) {
317
+			switch ($_GET['give-message']) {
318 318
 				case 'donor-deleted' :
319
-					Give()->notices->register_notice( array(
319
+					Give()->notices->register_notice(array(
320 320
 						'id'          => 'give-donor-deleted',
321 321
 						'type'        => 'updated',
322
-						'description' => __( 'The donor has been deleted.', 'give' ),
322
+						'description' => __('The donor has been deleted.', 'give'),
323 323
 						'show'        => true,
324
-					) );
324
+					));
325 325
 					break;
326 326
 
327 327
 				case 'email-added' :
328
-					Give()->notices->register_notice( array(
328
+					Give()->notices->register_notice(array(
329 329
 						'id'          => 'give-donor-email-added',
330 330
 						'type'        => 'updated',
331
-						'description' => __( 'Donor email added.', 'give' ),
331
+						'description' => __('Donor email added.', 'give'),
332 332
 						'show'        => true,
333
-					) );
333
+					));
334 334
 					break;
335 335
 
336 336
 				case 'email-removed' :
337
-					Give()->notices->register_notice( array(
337
+					Give()->notices->register_notice(array(
338 338
 						'id'          => 'give-donor-email-removed',
339 339
 						'type'        => 'updated',
340
-						'description' => __( 'Donor email removed.', 'give' ),
340
+						'description' => __('Donor email removed.', 'give'),
341 341
 						'show'        => true,
342
-					) );
342
+					));
343 343
 					break;
344 344
 
345 345
 				case 'email-remove-failed' :
346
-					Give()->notices->register_notice( array(
346
+					Give()->notices->register_notice(array(
347 347
 						'id'          => 'give-donor-email-remove-failed',
348 348
 						'type'        => 'updated',
349
-						'description' => __( 'Failed to remove donor email.', 'give' ),
349
+						'description' => __('Failed to remove donor email.', 'give'),
350 350
 						'show'        => true,
351
-					) );
351
+					));
352 352
 					break;
353 353
 
354 354
 				case 'primary-email-updated' :
355
-					Give()->notices->register_notice( array(
355
+					Give()->notices->register_notice(array(
356 356
 						'id'          => 'give-donor-primary-email-updated',
357 357
 						'type'        => 'updated',
358
-						'description' => __( 'Primary email updated for donor.', 'give' ),
358
+						'description' => __('Primary email updated for donor.', 'give'),
359 359
 						'show'        => true,
360
-					) );
360
+					));
361 361
 					break;
362 362
 
363 363
 				case 'primary-email-failed' :
364
-					Give()->notices->register_notice( array(
364
+					Give()->notices->register_notice(array(
365 365
 						'id'          => 'give-donor-primary-email-failed',
366 366
 						'type'        => 'updated',
367
-						'description' => __( 'Failed to set primary email.', 'give' ),
367
+						'description' => __('Failed to set primary email.', 'give'),
368 368
 						'show'        => true,
369
-					) );
369
+					));
370 370
 					break;
371 371
 			}
372 372
 		}
373 373
 	}
374 374
 }
375 375
 
376
-add_action( 'admin_notices', '_give_register_admin_notices', - 1 );
376
+add_action('admin_notices', '_give_register_admin_notices', - 1);
377 377
 
378 378
 
379 379
 /**
@@ -383,27 +383,26 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return bool
385 385
  */
386
-function _give_show_test_mode_notice_in_admin_bar( $wp_admin_bar ) {
387
-	$is_test_mode = ! empty( $_POST['test_mode'] ) ?
388
-		give_is_setting_enabled( $_POST['test_mode'] ) :
389
-		give_is_test_mode();
386
+function _give_show_test_mode_notice_in_admin_bar($wp_admin_bar) {
387
+	$is_test_mode = ! empty($_POST['test_mode']) ?
388
+		give_is_setting_enabled($_POST['test_mode']) : give_is_test_mode();
390 389
 
391 390
 	if (
392
-		! current_user_can( 'view_give_reports' ) ||
391
+		! current_user_can('view_give_reports') ||
393 392
 		! $is_test_mode
394 393
 	) {
395 394
 		return false;
396 395
 	}
397 396
 
398 397
 	// Add the main siteadmin menu item.
399
-	$wp_admin_bar->add_menu( array(
398
+	$wp_admin_bar->add_menu(array(
400 399
 		'id'     => 'give-test-notice',
401
-		'href'   => admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=gateways' ),
400
+		'href'   => admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways'),
402 401
 		'parent' => 'top-secondary',
403
-		'title'  => esc_html__( 'Give Test Mode Active', 'give' ),
404
-		'meta'   => array( 'class' => 'give-test-mode-active' ),
405
-	) );
402
+		'title'  => esc_html__('Give Test Mode Active', 'give'),
403
+		'meta'   => array('class' => 'give-test-mode-active'),
404
+	));
406 405
 
407 406
 	return true;
408 407
 }
409
-add_action( 'admin_bar_menu', '_give_show_test_mode_notice_in_admin_bar', 1000, 1 );
410 408
\ No newline at end of file
409
+add_action('admin_bar_menu', '_give_show_test_mode_notice_in_admin_bar', 1000, 1);
411 410
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-general.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 							'default' => '',
91 91
 							'type'    => 'text'
92 92
 						),
93
-                        array(
94
-                            'name'  => esc_html__( 'Access Control Docs Link', 'give' ),
95
-                            'id'    => 'access_control_docs_link',
96
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
97
-                            'title' => __( 'Access Control', 'give' ),
98
-                            'type'  => 'give_docs_link',
99
-                        ),
93
+						array(
94
+							'name'  => esc_html__( 'Access Control Docs Link', 'give' ),
95
+							'id'    => 'access_control_docs_link',
96
+							'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
97
+							'title' => __( 'Access Control', 'give' ),
98
+							'type'  => 'give_docs_link',
99
+						),
100 100
 						array(
101 101
 							'id'   => 'give_title_session_control_1',
102 102
 							'type' => 'sectionend'
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
 							'default'         => 2,
163 163
 							'css'             => 'width:12em;',
164 164
 						),
165
-                        array(
166
-                            'name'  => esc_html__( 'Currency Options Docs Link', 'give' ),
167
-                            'id'    => 'currency_settings_docs_link',
168
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
169
-                            'title' => __( 'Currency Settings', 'give' ),
170
-                            'type'  => 'give_docs_link',
171
-                        ),
165
+						array(
166
+							'name'  => esc_html__( 'Currency Options Docs Link', 'give' ),
167
+							'id'    => 'currency_settings_docs_link',
168
+							'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
169
+							'title' => __( 'Currency Settings', 'give' ),
170
+							'type'  => 'give_docs_link',
171
+						),
172 172
 						array(
173 173
 							'type' => 'sectionend',
174 174
 							'id'   => 'give_title_general_settings_2'
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
 							'options' => give_states_list()[ get_option( 'give_settings' )['base_country'] ],
237 237
 						),
238 238
 						array(
239
-						    'name'  => esc_html__( 'General Options Docs Link', 'give' ),
240
-						    'id'    => 'general_options_docs_link',
241
-						    'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
242
-						    'title' => __( 'General Options', 'give' ),
243
-						    'type'  => 'give_docs_link',
239
+							'name'  => esc_html__( 'General Options Docs Link', 'give' ),
240
+							'id'    => 'general_options_docs_link',
241
+							'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
242
+							'title' => __( 'General Options', 'give' ),
243
+							'type'  => 'give_docs_link',
244 244
 						),
245 245
 						array(
246 246
 							'type' => 'sectionend',
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_General' ) ) :
16
+if ( ! class_exists('Give_Settings_General')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_General.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'general';
30
-			$this->label = esc_html__( 'General', 'give' );
30
+			$this->label = esc_html__('General', 'give');
31 31
 
32 32
 			$this->default_tab = 'general-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings        = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'access-control':
49 49
 					$settings = array(
50 50
 						// Section 3: Access control.
@@ -54,47 +54,47 @@  discard block
 block discarded – undo
54 54
 						),
55 55
 						array(
56 56
 							'id'      => 'session_lifetime',
57
-							'name'    => esc_html__( 'Session Lifetime', 'give' ),
58
-							'desc'    => esc_html__( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
57
+							'name'    => esc_html__('Session Lifetime', 'give'),
58
+							'desc'    => esc_html__('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
59 59
 							'type'    => 'select',
60 60
 							'options' => array(
61
-								'86400'  => esc_html__( '24 Hours', 'give' ),
62
-								'172800' => esc_html__( '48 Hours', 'give' ),
63
-								'259200' => esc_html__( '72 Hours', 'give' ),
64
-								'604800' => esc_html__( '1 Week', 'give' ),
61
+								'86400'  => esc_html__('24 Hours', 'give'),
62
+								'172800' => esc_html__('48 Hours', 'give'),
63
+								'259200' => esc_html__('72 Hours', 'give'),
64
+								'604800' => esc_html__('1 Week', 'give'),
65 65
 							)
66 66
 						),
67 67
 						array(
68
-							'name'    => esc_html__( 'Email Access', 'give' ),
69
-							'desc'    => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
68
+							'name'    => esc_html__('Email Access', 'give'),
69
+							'desc'    => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
70 70
 							'id'      => 'email_access',
71 71
 							'type'    => 'radio_inline',
72 72
 							'default' => 'disabled',
73 73
 							'options' => array(
74
-								'enabled'  => __( 'Enabled', 'give' ),
75
-								'disabled' => __( 'Disabled', 'give' ),
74
+								'enabled'  => __('Enabled', 'give'),
75
+								'disabled' => __('Disabled', 'give'),
76 76
 							)
77 77
 						),
78 78
 						array(
79 79
 							'id'      => 'recaptcha_key',
80
-							'name'    => esc_html__( 'reCAPTCHA Site Key', 'give' ),
80
+							'name'    => esc_html__('reCAPTCHA Site Key', 'give'),
81 81
 							/* translators: %s: https://www.google.com/recaptcha/ */
82
-							'desc'    => sprintf( __( 'Please paste your reCAPTCHA site key here. <br />If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'http://docs.givewp.com/recaptcha' ) ),
82
+							'desc'    => sprintf(__('Please paste your reCAPTCHA site key here. <br />If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('http://docs.givewp.com/recaptcha')),
83 83
 							'default' => '',
84 84
 							'type'    => 'text'
85 85
 						),
86 86
 						array(
87 87
 							'id'      => 'recaptcha_secret',
88
-							'name'    => esc_html__( 'reCAPTCHA Secret Key', 'give' ),
89
-							'desc'    => esc_html__( 'Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give' ),
88
+							'name'    => esc_html__('reCAPTCHA Secret Key', 'give'),
89
+							'desc'    => esc_html__('Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give'),
90 90
 							'default' => '',
91 91
 							'type'    => 'text'
92 92
 						),
93 93
                         array(
94
-                            'name'  => esc_html__( 'Access Control Docs Link', 'give' ),
94
+                            'name'  => esc_html__('Access Control Docs Link', 'give'),
95 95
                             'id'    => 'access_control_docs_link',
96
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
97
-                            'title' => __( 'Access Control', 'give' ),
96
+                            'url'   => esc_url('http://docs.givewp.com/settings-access-control'),
97
+                            'title' => __('Access Control', 'give'),
98 98
                             'type'  => 'give_docs_link',
99 99
                         ),
100 100
 						array(
@@ -112,61 +112,61 @@  discard block
 block discarded – undo
112 112
 							'id'   => 'give_title_general_settings_2'
113 113
 						),
114 114
 						array(
115
-							'name' => esc_html__( 'Currency Settings', 'give' ),
115
+							'name' => esc_html__('Currency Settings', 'give'),
116 116
 							'desc' => '',
117 117
 							'type' => 'give_title',
118 118
 							'id'   => 'give_title_general_settings_2'
119 119
 						),
120 120
 						array(
121
-							'name'    => esc_html__( 'Currency', 'give' ),
122
-							'desc'    => esc_html__( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
121
+							'name'    => esc_html__('Currency', 'give'),
122
+							'desc'    => esc_html__('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
123 123
 							'id'      => 'currency',
124 124
 							'type'    => 'select',
125 125
 							'options' => give_get_currencies(),
126 126
 							'default' => 'USD',
127 127
 						),
128 128
 						array(
129
-							'name'    => esc_html__( 'Currency Position', 'give' ),
130
-							'desc'    => esc_html__( 'The position of the currency symbol.', 'give' ),
129
+							'name'    => esc_html__('Currency Position', 'give'),
130
+							'desc'    => esc_html__('The position of the currency symbol.', 'give'),
131 131
 							'id'      => 'currency_position',
132 132
 							'type'    => 'select',
133 133
 							'options' => array(
134 134
 								/* translators: %s: currency symbol */
135
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
135
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
136 136
 								/* translators: %s: currency symbol */
137
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) )
137
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency()))
138 138
 							),
139 139
 							'default' => 'before',
140 140
 						),
141 141
 						array(
142
-							'name'    => esc_html__( 'Thousands Separator', 'give' ),
143
-							'desc'    => esc_html__( 'The symbol (typically , or .) to separate thousands.', 'give' ),
142
+							'name'    => esc_html__('Thousands Separator', 'give'),
143
+							'desc'    => esc_html__('The symbol (typically , or .) to separate thousands.', 'give'),
144 144
 							'id'      => 'thousands_separator',
145 145
 							'type'    => 'text',
146 146
 							'default' => ',',
147 147
 							'css'     => 'width:12em;',
148 148
 						),
149 149
 						array(
150
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
151
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
150
+							'name'    => esc_html__('Decimal Separator', 'give'),
151
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
152 152
 							'id'      => 'decimal_separator',
153 153
 							'type'    => 'text',
154 154
 							'default' => '.',
155 155
 							'css'     => 'width:12em;',
156 156
 						),
157 157
 						array(
158
-							'name'            => __( 'Number of Decimals', 'give' ),
159
-							'desc'            => __( 'The number of decimal points displayed in amounts.', 'give' ),
158
+							'name'            => __('Number of Decimals', 'give'),
159
+							'desc'            => __('The number of decimal points displayed in amounts.', 'give'),
160 160
 							'id'              => 'number_decimals',
161 161
 							'type'            => 'text',
162 162
 							'default'         => 2,
163 163
 							'css'             => 'width:12em;',
164 164
 						),
165 165
                         array(
166
-                            'name'  => esc_html__( 'Currency Options Docs Link', 'give' ),
166
+                            'name'  => esc_html__('Currency Options Docs Link', 'give'),
167 167
                             'id'    => 'currency_settings_docs_link',
168
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
169
-                            'title' => __( 'Currency Settings', 'give' ),
168
+                            'url'   => esc_url('http://docs.givewp.com/settings-currency'),
169
+                            'title' => __('Currency Settings', 'give'),
170 170
                             'type'  => 'give_docs_link',
171 171
                         ),
172 172
 						array(
@@ -184,62 +184,62 @@  discard block
 block discarded – undo
184 184
 							'id'   => 'give_title_general_settings_1'
185 185
 						),
186 186
 						array(
187
-							'name' => esc_html__( 'General Settings', 'give' ),
187
+							'name' => esc_html__('General Settings', 'give'),
188 188
 							'desc' => '',
189 189
 							'type' => 'give_title',
190 190
 							'id'   => 'give_title_general_settings_1'
191 191
 						),
192 192
 						array(
193
-							'name'    => esc_html__( 'Success Page', 'give' ),
193
+							'name'    => esc_html__('Success Page', 'give'),
194 194
 							/* translators: %s: [give_receipt] */
195
-							'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>' ),
195
+							'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>'),
196 196
 							'id'      => 'success_page',
197 197
 							'type'    => 'select',
198
-							'options' => give_cmb2_get_post_options( array(
198
+							'options' => give_cmb2_get_post_options(array(
199 199
 								'post_type'   => 'page',
200
-								'numberposts' => - 1
201
-							) ),
200
+								'numberposts' => -1
201
+							)),
202 202
 						),
203 203
 						array(
204
-							'name'    => esc_html__( 'Failed Donation Page', 'give' ),
205
-							'desc'    => esc_html__( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
204
+							'name'    => esc_html__('Failed Donation Page', 'give'),
205
+							'desc'    => esc_html__('The page donors are sent to if their donation is cancelled or fails.', 'give'),
206 206
 							'id'      => 'failure_page',
207 207
 							'type'    => 'select',
208
-							'options' => give_cmb2_get_post_options( array(
208
+							'options' => give_cmb2_get_post_options(array(
209 209
 								'post_type'   => 'page',
210
-								'numberposts' => - 1
211
-							) ),
210
+								'numberposts' => -1
211
+							)),
212 212
 						),
213 213
 						array(
214
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
214
+							'name'    => esc_html__('Donation History Page', 'give'),
215 215
 							/* translators: %s: [donation_history] */
216
-							'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>' ),
216
+							'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>'),
217 217
 							'id'      => 'history_page',
218 218
 							'type'    => 'select',
219
-							'options' => give_cmb2_get_post_options( array(
219
+							'options' => give_cmb2_get_post_options(array(
220 220
 								'post_type'   => 'page',
221
-								'numberposts' => - 1
222
-							) ),
221
+								'numberposts' => -1
222
+							)),
223 223
 						),
224 224
 						array(
225
-							'name'    => esc_html__( 'Base Country', 'give' ),
226
-							'desc'    => esc_html__( 'The country your site operates from.', 'give' ),
225
+							'name'    => esc_html__('Base Country', 'give'),
226
+							'desc'    => esc_html__('The country your site operates from.', 'give'),
227 227
 							'id'      => 'base_country',
228 228
 							'type'    => 'select',
229 229
 							'options' => give_get_country_list(),
230 230
 						),
231 231
 						array(
232
-							'name'    => esc_html__( 'Default State/Province', 'give' ),
233
-							'desc'    => esc_html__( 'The state/province your site operates from.', 'give' ),
232
+							'name'    => esc_html__('Default State/Province', 'give'),
233
+							'desc'    => esc_html__('The state/province your site operates from.', 'give'),
234 234
 							'id'      => 'base_state',
235 235
 							'type'    => 'select',
236
-							'options' => give_states_list()[ get_option( 'give_settings' )['base_country'] ],
236
+							'options' => give_states_list()[get_option('give_settings')['base_country']],
237 237
 						),
238 238
 						array(
239
-						    'name'  => esc_html__( 'General Options Docs Link', 'give' ),
239
+						    'name'  => esc_html__('General Options Docs Link', 'give'),
240 240
 						    'id'    => 'general_options_docs_link',
241
-						    'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
242
-						    'title' => __( 'General Options', 'give' ),
241
+						    'url'   => esc_url('http://docs.givewp.com/settings-general'),
242
+						    'title' => __('General Options', 'give'),
243 243
 						    'type'  => 'give_docs_link',
244 244
 						),
245 245
 						array(
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 			 * Filter the general settings.
255 255
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
256 256
 			 */
257
-			$settings = apply_filters( 'give_settings_general', $settings );
257
+			$settings = apply_filters('give_settings_general', $settings);
258 258
 
259 259
 			/**
260 260
 			 * Filter the settings.
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 			 *
264 264
 			 * @param  array $settings
265 265
 			 */
266
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
266
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
267 267
 
268 268
 			// Output.
269 269
 			return $settings;
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
 		 */
278 278
 		public function get_sections() {
279 279
 			$sections = array(
280
-				'general-settings'  => esc_html__( 'General', 'give' ),
281
-				'currency-settings' => esc_html__( 'Currency', 'give' ),
282
-				'access-control'    => esc_html__( 'Access Control', 'give' )
280
+				'general-settings'  => esc_html__('General', 'give'),
281
+				'currency-settings' => esc_html__('Currency', 'give'),
282
+				'access-control'    => esc_html__('Access Control', 'give')
283 283
 			);
284 284
 
285
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
285
+			return apply_filters('give_get_sections_'.$this->id, $sections);
286 286
 		}
287 287
 	}
288 288
 
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 1 patch
Spacing   +378 added lines, -378 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 	public function __construct() {
44 44
 
45 45
 		// Custom CMB2 Settings Fields
46
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
47
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
48
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
49
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
50
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
51
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
52
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
53
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
46
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
47
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
48
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
49
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
50
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
51
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
52
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
53
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
54 54
 	}
55 55
 
56 56
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @since  1.0
61 61
 	 */
62 62
 	public function init() {
63
-		register_setting( $this->key, $this->key );
63
+		register_setting($this->key, $this->key);
64 64
 
65 65
 	}
66 66
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return mixed
76 76
 	 */
77
-	public function give_update_cmb_meta_box_url( $url ) {
77
+	public function give_update_cmb_meta_box_url($url) {
78 78
 		// Path to Give's CMB
79
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
79
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
80 80
 	}
81 81
 
82 82
 
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function give_get_settings_tabs() {
90 90
 
91
-		$settings = $this->give_settings( null );
91
+		$settings = $this->give_settings(null);
92 92
 
93 93
 		$tabs             = array();
94
-		$tabs['general']  = __( 'General', 'give' );
95
-		$tabs['gateways'] = __( 'Payment Gateways', 'give' );
96
-		$tabs['display']  = __( 'Display Options', 'give' );
97
-		$tabs['emails']   = __( 'Emails', 'give' );
94
+		$tabs['general']  = __('General', 'give');
95
+		$tabs['gateways'] = __('Payment Gateways', 'give');
96
+		$tabs['display']  = __('Display Options', 'give');
97
+		$tabs['emails']   = __('Emails', 'give');
98 98
 
99
-		if ( ! empty( $settings['addons']['fields'] ) ) {
100
-			$tabs['addons'] = __( 'Add-ons', 'give' );
99
+		if ( ! empty($settings['addons']['fields'])) {
100
+			$tabs['addons'] = __('Add-ons', 'give');
101 101
 		}
102 102
 
103
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
104
-			$tabs['licenses'] = __( 'Licenses', 'give' );
103
+		if ( ! empty($settings['licenses']['fields'])) {
104
+			$tabs['licenses'] = __('Licenses', 'give');
105 105
 		}
106 106
 
107
-		$tabs['advanced']    = __( 'Advanced', 'give' );
108
-		$tabs['api']         = __( 'API', 'give' );
109
-		$tabs['system_info'] = __( 'System Info', 'give' );
107
+		$tabs['advanced']    = __('Advanced', 'give');
108
+		$tabs['api']         = __('API', 'give');
109
+		$tabs['system_info'] = __('System Info', 'give');
110 110
 
111
-		return apply_filters( 'give_settings_tabs', $tabs );
111
+		return apply_filters('give_settings_tabs', $tabs);
112 112
 	}
113 113
 
114 114
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function admin_page_display() {
121 121
 
122
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
122
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
123 123
 
124 124
 		?>
125 125
 
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
 
130 130
 			<h2 class="nav-tab-wrapper">
131 131
 				<?php
132
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
132
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
133 133
 
134
-					$tab_url = esc_url( add_query_arg( array(
134
+					$tab_url = esc_url(add_query_arg(array(
135 135
 						'settings-updated' => false,
136 136
 						'tab'              => $tab_id,
137
-					) ) );
137
+					)));
138 138
 
139 139
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
140 140
 
141
-					echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
141
+					echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
142 142
 
143 143
 				}
144 144
 				?>
145 145
 			</h2>
146 146
 
147
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
147
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
148 148
 
149 149
 		</div><!-- .wrap -->
150 150
 
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @return string
168 168
 	 */
169
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
169
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
170 170
 
171 171
 		// only modify the give settings form
172
-		if ( 'give_settings' == $object_id ) {
172
+		if ('give_settings' == $object_id) {
173 173
 
174
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
174
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>';
175 175
 
176 176
 		}
177 177
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @return array
190 190
 	 */
191
-	public function give_settings( $active_tab ) {
191
+	public function give_settings($active_tab) {
192 192
 
193 193
 		$give_settings = array(
194 194
 			/**
@@ -196,106 +196,106 @@  discard block
 block discarded – undo
196 196
 			 */
197 197
 			'general'     => array(
198 198
 				'id'         => 'general_settings',
199
-				'give_title' => __( 'General Settings', 'give' ),
200
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
201
-				'fields'     => apply_filters( 'give_settings_general', array(
199
+				'give_title' => __('General Settings', 'give'),
200
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
201
+				'fields'     => apply_filters('give_settings_general', array(
202 202
 						array(
203
-							'name' => __( 'General Settings', 'give' ),
203
+							'name' => __('General Settings', 'give'),
204 204
 							'desc' => '',
205 205
 							'type' => 'give_title',
206 206
 							'id'   => 'give_title_general_settings_1',
207 207
 						),
208 208
 						array(
209
-							'name'    => __( 'Success Page', 'give' ),
209
+							'name'    => __('Success Page', 'give'),
210 210
 							/* translators: %s: [give_receipt] */
211
-							'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>' ),
211
+							'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>'),
212 212
 							'id'      => 'success_page',
213 213
 							'type'    => 'select',
214
-							'options' => give_cmb2_get_post_options( array(
214
+							'options' => give_cmb2_get_post_options(array(
215 215
 								'post_type'   => 'page',
216
-								'numberposts' => - 1,
217
-							) ),
216
+								'numberposts' => -1,
217
+							)),
218 218
 						),
219 219
 						array(
220
-							'name'    => __( 'Failed Donation Page', 'give' ),
221
-							'desc'    => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
220
+							'name'    => __('Failed Donation Page', 'give'),
221
+							'desc'    => __('The page donors are sent to if their donation is cancelled or fails.', 'give'),
222 222
 							'id'      => 'failure_page',
223 223
 							'type'    => 'select',
224
-							'options' => give_cmb2_get_post_options( array(
224
+							'options' => give_cmb2_get_post_options(array(
225 225
 								'post_type'   => 'page',
226
-								'numberposts' => - 1,
227
-							) ),
226
+								'numberposts' => -1,
227
+							)),
228 228
 						),
229 229
 						array(
230
-							'name'    => __( 'Donation History Page', 'give' ),
230
+							'name'    => __('Donation History Page', 'give'),
231 231
 							/* translators: %s: [donation_history] */
232
-							'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>' ),
232
+							'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>'),
233 233
 							'id'      => 'history_page',
234 234
 							'type'    => 'select',
235
-							'options' => give_cmb2_get_post_options( array(
235
+							'options' => give_cmb2_get_post_options(array(
236 236
 								'post_type'   => 'page',
237
-								'numberposts' => - 1,
238
-							) ),
237
+								'numberposts' => -1,
238
+							)),
239 239
 						),
240 240
 						array(
241
-							'name'    => __( 'Base Country', 'give' ),
242
-							'desc'    => __( 'The country your site operates from.', 'give' ),
241
+							'name'    => __('Base Country', 'give'),
242
+							'desc'    => __('The country your site operates from.', 'give'),
243 243
 							'id'      => 'base_country',
244 244
 							'type'    => 'select',
245 245
 							'options' => give_get_country_list(),
246 246
 						),
247 247
 						array(
248
-							'name'    => esc_html__( 'Default State/Province', 'give' ),
249
-							'desc'    => esc_html__( 'The state/province your site operates from.', 'give' ),
248
+							'name'    => esc_html__('Default State/Province', 'give'),
249
+							'desc'    => esc_html__('The state/province your site operates from.', 'give'),
250 250
 							'id'      => 'base_state',
251 251
 							'type'    => 'select',
252
-							'options' => give_states_list()[ get_option( 'give_settings' )['base_country'] ],
252
+							'options' => give_states_list()[get_option('give_settings')['base_country']],
253 253
 						),
254 254
 						array(
255
-							'name' => __( 'Currency Settings', 'give' ),
255
+							'name' => __('Currency Settings', 'give'),
256 256
 							'desc' => '',
257 257
 							'type' => 'give_title',
258 258
 							'id'   => 'give_title_general_settings_2',
259 259
 						),
260 260
 						array(
261
-							'name'    => __( 'Currency', 'give' ),
262
-							'desc'    => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
261
+							'name'    => __('Currency', 'give'),
262
+							'desc'    => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
263 263
 							'id'      => 'currency',
264 264
 							'type'    => 'select',
265 265
 							'options' => give_get_currencies(),
266 266
 							'default' => 'USD',
267 267
 						),
268 268
 						array(
269
-							'name'    => __( 'Currency Position', 'give' ),
270
-							'desc'    => __( 'The position of the currency symbol.', 'give' ),
269
+							'name'    => __('Currency Position', 'give'),
270
+							'desc'    => __('The position of the currency symbol.', 'give'),
271 271
 							'id'      => 'currency_position',
272 272
 							'type'    => 'select',
273 273
 							'options' => array(
274 274
 								/* translators: %s: currency symbol */
275
-								'before' => sprintf( __( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
275
+								'before' => sprintf(__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
276 276
 								/* translators: %s: currency symbol */
277
-								'after'  => sprintf( __( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) ),
277
+								'after'  => sprintf(__('After - 10%s', 'give'), give_currency_symbol(give_get_currency())),
278 278
 							),
279 279
 							'default' => 'before',
280 280
 						),
281 281
 						array(
282
-							'name'            => __( 'Thousands Separator', 'give' ),
283
-							'desc'            => __( 'The symbol (usually , or .) to separate thousands.', 'give' ),
282
+							'name'            => __('Thousands Separator', 'give'),
283
+							'desc'            => __('The symbol (usually , or .) to separate thousands.', 'give'),
284 284
 							'id'              => 'thousands_separator',
285 285
 							'type'            => 'text_small',
286 286
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
287 287
 							'default'         => ',',
288 288
 						),
289 289
 						array(
290
-							'name'    => __( 'Decimal Separator', 'give' ),
291
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
290
+							'name'    => __('Decimal Separator', 'give'),
291
+							'desc'    => __('The symbol (usually , or .) to separate decimal points.', 'give'),
292 292
 							'id'      => 'decimal_separator',
293 293
 							'type'    => 'text_small',
294 294
 							'default' => '.',
295 295
 						),
296 296
 						array(
297
-							'name'            => __( 'Number of Decimals', 'give' ),
298
-							'desc'            => __( 'The number of decimal points displayed in amounts.', 'give' ),
297
+							'name'            => __('Number of Decimals', 'give'),
298
+							'desc'            => __('The number of decimal points displayed in amounts.', 'give'),
299 299
 							'id'              => 'number_decimals',
300 300
 							'type'            => 'text_small',
301 301
 							'default'         => 2,
@@ -309,83 +309,83 @@  discard block
 block discarded – undo
309 309
 			 */
310 310
 			'gateways'    => array(
311 311
 				'id'         => 'payment_gateways',
312
-				'give_title' => __( 'Payment Gateways', 'give' ),
313
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
314
-				'fields'     => apply_filters( 'give_settings_gateways', array(
312
+				'give_title' => __('Payment Gateways', 'give'),
313
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
314
+				'fields'     => apply_filters('give_settings_gateways', array(
315 315
 						array(
316
-							'name' => __( 'Gateways Settings', 'give' ),
316
+							'name' => __('Gateways Settings', 'give'),
317 317
 							'desc' => '',
318 318
 							'id'   => 'give_title_gateway_settings_1',
319 319
 							'type' => 'give_title',
320 320
 						),
321 321
 						array(
322
-							'name' => __( 'Test Mode', 'give' ),
323
-							'desc' => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
322
+							'name' => __('Test Mode', 'give'),
323
+							'desc' => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
324 324
 							'id'   => 'test_mode',
325 325
 							'type' => 'checkbox',
326 326
 						),
327 327
 						array(
328
-							'name' => __( 'Enabled Gateways', 'give' ),
329
-							'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
328
+							'name' => __('Enabled Gateways', 'give'),
329
+							'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'),
330 330
 							'id'   => 'gateways',
331 331
 							'type' => 'enabled_gateways',
332 332
 						),
333 333
 						array(
334
-							'name' => __( 'Default Gateway', 'give' ),
335
-							'desc' => __( 'The gateway that will be selected by default.', 'give' ),
334
+							'name' => __('Default Gateway', 'give'),
335
+							'desc' => __('The gateway that will be selected by default.', 'give'),
336 336
 							'id'   => 'default_gateway',
337 337
 							'type' => 'default_gateway',
338 338
 						),
339 339
 						array(
340
-							'name' => __( 'PayPal Standard', 'give' ),
340
+							'name' => __('PayPal Standard', 'give'),
341 341
 							'desc' => '',
342 342
 							'type' => 'give_title',
343 343
 							'id'   => 'give_title_gateway_settings_2',
344 344
 						),
345 345
 						array(
346
-							'name' => __( 'PayPal Email', 'give' ),
347
-							'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
346
+							'name' => __('PayPal Email', 'give'),
347
+							'desc' => __('Enter your PayPal account\'s email.', 'give'),
348 348
 							'id'   => 'paypal_email',
349 349
 							'type' => 'text_email',
350 350
 						),
351 351
 						array(
352
-							'name' => __( 'PayPal Page Style', 'give' ),
353
-							'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
352
+							'name' => __('PayPal Page Style', 'give'),
353
+							'desc' => __('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
354 354
 							'id'   => 'paypal_page_style',
355 355
 							'type' => 'text',
356 356
 						),
357 357
 						array(
358
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
359
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
358
+							'name'    => __('PayPal Transaction Type', 'give'),
359
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
360 360
 							'id'      => 'paypal_button_type',
361 361
 							'type'    => 'radio_inline',
362 362
 							'options' => array(
363
-								'donation' => __( 'Donation', 'give' ),
364
-								'standard' => __( 'Standard Transaction', 'give' ),
363
+								'donation' => __('Donation', 'give'),
364
+								'standard' => __('Standard Transaction', 'give'),
365 365
 							),
366 366
 							'default' => 'donation',
367 367
 						),
368 368
 						array(
369
-							'name' => __( 'Disable PayPal IPN Verification', 'give' ),
370
-							'desc' => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
369
+							'name' => __('Disable PayPal IPN Verification', 'give'),
370
+							'desc' => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
371 371
 							'id'   => 'disable_paypal_verification',
372 372
 							'type' => 'checkbox',
373 373
 						),
374 374
 						array(
375
-							'name' => __( 'Offline Donations', 'give' ),
375
+							'name' => __('Offline Donations', 'give'),
376 376
 							'desc' => '',
377 377
 							'type' => 'give_title',
378 378
 							'id'   => 'give_title_gateway_settings_3',
379 379
 						),
380 380
 						array(
381
-							'name' => __( 'Collect Billing Details', 'give' ),
382
-							'desc' => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
381
+							'name' => __('Collect Billing Details', 'give'),
382
+							'desc' => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
383 383
 							'id'   => 'give_offline_donation_enable_billing_fields',
384 384
 							'type' => 'checkbox',
385 385
 						),
386 386
 						array(
387
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
388
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
387
+							'name'    => __('Offline Donation Instructions', 'give'),
388
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
389 389
 							'id'      => 'global_offline_donation_content',
390 390
 							'default' => give_get_default_offline_donation_content(),
391 391
 							'type'    => 'wysiwyg',
@@ -394,15 +394,15 @@  discard block
 block discarded – undo
394 394
 							),
395 395
 						),
396 396
 						array(
397
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
398
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
397
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
398
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
399 399
 							'id'      => 'offline_donation_subject',
400
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
400
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
401 401
 							'type'    => 'text',
402 402
 						),
403 403
 						array(
404
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
405
-							'desc'    => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
404
+							'name'    => __('Offline Donation Email Instructions', 'give'),
405
+							'desc'    => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
406 406
 							'id'      => 'global_offline_donation_email',
407 407
 							'default' => give_get_default_offline_donation_email_content(),
408 408
 							'type'    => 'wysiwyg',
@@ -416,104 +416,104 @@  discard block
 block discarded – undo
416 416
 			/** Display Settings */
417 417
 			'display'     => array(
418 418
 				'id'         => 'display_settings',
419
-				'give_title' => __( 'Display Settings', 'give' ),
420
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
421
-				'fields'     => apply_filters( 'give_settings_display', array(
419
+				'give_title' => __('Display Settings', 'give'),
420
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
421
+				'fields'     => apply_filters('give_settings_display', array(
422 422
 						array(
423
-							'name' => __( 'Display Settings', 'give' ),
423
+							'name' => __('Display Settings', 'give'),
424 424
 							'desc' => '',
425 425
 							'id'   => 'give_title_display_settings_1',
426 426
 							'type' => 'give_title',
427 427
 						),
428 428
 						array(
429
-							'name' => __( 'Disable CSS', 'give' ),
430
-							'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
429
+							'name' => __('Disable CSS', 'give'),
430
+							'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
431 431
 							'id'   => 'disable_css',
432 432
 							'type' => 'checkbox',
433 433
 						),
434 434
 						array(
435
-							'name' => __( 'Enable Floating Labels', 'give' ),
435
+							'name' => __('Enable Floating Labels', 'give'),
436 436
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
437
-							'desc' => sprintf( wp_kses( __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array(
437
+							'desc' => sprintf(wp_kses(__('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array(
438 438
 								'a' => array(
439 439
 									'href'   => array(),
440 440
 									'target' => array(),
441 441
 								),
442
-							) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
442
+							)), esc_url('http://docs.givewp.com/form-floating-labels')),
443 443
 							'id'   => 'floatlabels',
444 444
 							'type' => 'checkbox',
445 445
 						),
446 446
 						array(
447
-							'name' => __( 'Disable Welcome Screen', 'give' ),
447
+							'name' => __('Disable Welcome Screen', 'give'),
448 448
 							/* translators: %s: about page URL */
449
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array(
449
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array(
450 450
 								'a' => array(
451 451
 									'href'   => array(),
452 452
 									'target' => array(),
453 453
 								),
454
-							) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
454
+							)), esc_url(admin_url('index.php?page=give-about'))),
455 455
 							'id'   => 'disable_welcome',
456 456
 							'type' => 'checkbox',
457 457
 						),
458 458
 						array(
459
-							'name' => __( 'Post Types', 'give' ),
459
+							'name' => __('Post Types', 'give'),
460 460
 							'desc' => '',
461 461
 							'id'   => 'give_title_display_settings_2',
462 462
 							'type' => 'give_title',
463 463
 						),
464 464
 						array(
465
-							'name' => __( 'Disable Form Single Views', 'give' ),
466
-							'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
465
+							'name' => __('Disable Form Single Views', 'give'),
466
+							'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
467 467
 							'id'   => 'disable_forms_singular',
468 468
 							'type' => 'checkbox',
469 469
 						),
470 470
 						array(
471
-							'name' => __( 'Disable Form Archives', 'give' ),
472
-							'desc' => __( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
471
+							'name' => __('Disable Form Archives', 'give'),
472
+							'desc' => __('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
473 473
 							'id'   => 'disable_forms_archives',
474 474
 							'type' => 'checkbox',
475 475
 						),
476 476
 						array(
477
-							'name' => __( 'Disable Form Excerpts', 'give' ),
478
-							'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
477
+							'name' => __('Disable Form Excerpts', 'give'),
478
+							'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
479 479
 							'id'   => 'disable_forms_excerpt',
480 480
 							'type' => 'checkbox',
481 481
 						),
482 482
 						array(
483
-							'name'    => __( 'Featured Image Size', 'give' ),
484
-							'desc'    => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
483
+							'name'    => __('Featured Image Size', 'give'),
484
+							'desc'    => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
485 485
 							'id'      => 'featured_image_size',
486 486
 							'type'    => 'select',
487 487
 							'default' => 'large',
488 488
 							'options' => give_get_featured_image_sizes(),
489 489
 						),
490 490
 						array(
491
-							'name' => __( 'Disable Form Featured Image', 'give' ),
492
-							'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
491
+							'name' => __('Disable Form Featured Image', 'give'),
492
+							'desc' => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
493 493
 							'id'   => 'disable_form_featured_img',
494 494
 							'type' => 'checkbox',
495 495
 						),
496 496
 						array(
497
-							'name' => __( 'Disable Single Form Sidebar', 'give' ),
498
-							'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
497
+							'name' => __('Disable Single Form Sidebar', 'give'),
498
+							'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
499 499
 							'id'   => 'disable_form_sidebar',
500 500
 							'type' => 'checkbox',
501 501
 						),
502 502
 						array(
503
-							'name' => __( 'Taxonomies', 'give' ),
503
+							'name' => __('Taxonomies', 'give'),
504 504
 							'desc' => '',
505 505
 							'id'   => 'give_title_display_settings_3',
506 506
 							'type' => 'give_title',
507 507
 						),
508 508
 						array(
509
-							'name' => __( 'Enable Form Categories', 'give' ),
510
-							'desc' => __( 'Enables the "Category" taxonomy for all Give forms.', 'give' ),
509
+							'name' => __('Enable Form Categories', 'give'),
510
+							'desc' => __('Enables the "Category" taxonomy for all Give forms.', 'give'),
511 511
 							'id'   => 'categories',
512 512
 							'type' => 'checkbox',
513 513
 						),
514 514
 						array(
515
-							'name' => __( 'Enable Form Tags', 'give' ),
516
-							'desc' => __( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ),
515
+							'name' => __('Enable Form Tags', 'give'),
516
+							'desc' => __('Enables the "Tag" taxonomy for all Give forms.', 'give'),
517 517
 							'id'   => 'tags',
518 518
 							'type' => 'checkbox',
519 519
 						),
@@ -526,101 +526,101 @@  discard block
 block discarded – undo
526 526
 			 */
527 527
 			'emails'      => array(
528 528
 				'id'         => 'email_settings',
529
-				'give_title' => __( 'Email Settings', 'give' ),
530
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
531
-				'fields'     => apply_filters( 'give_settings_emails', array(
529
+				'give_title' => __('Email Settings', 'give'),
530
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
531
+				'fields'     => apply_filters('give_settings_emails', array(
532 532
 						array(
533
-							'name' => __( 'Email Settings', 'give' ),
533
+							'name' => __('Email Settings', 'give'),
534 534
 							'desc' => '',
535 535
 							'id'   => 'give_title_email_settings_1',
536 536
 							'type' => 'give_title',
537 537
 						),
538 538
 						array(
539 539
 							'id'      => 'email_template',
540
-							'name'    => __( 'Email Template', 'give' ),
541
-							'desc'    => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
540
+							'name'    => __('Email Template', 'give'),
541
+							'desc'    => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
542 542
 							'type'    => 'select',
543 543
 							'options' => give_get_email_templates(),
544 544
 						),
545 545
 						array(
546 546
 							'id'   => 'email_logo',
547
-							'name' => __( 'Logo', 'give' ),
548
-							'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
547
+							'name' => __('Logo', 'give'),
548
+							'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
549 549
 							'type' => 'file',
550 550
 						),
551 551
 						array(
552 552
 							'id'      => 'from_name',
553
-							'name'    => __( 'From Name', 'give' ),
554
-							'desc'    => __( 'The name that appears in the "From" field in donation receipt emails.', 'give' ),
555
-							'default' => get_bloginfo( 'name' ),
553
+							'name'    => __('From Name', 'give'),
554
+							'desc'    => __('The name that appears in the "From" field in donation receipt emails.', 'give'),
555
+							'default' => get_bloginfo('name'),
556 556
 							'type'    => 'text',
557 557
 						),
558 558
 						array(
559 559
 							'id'      => 'from_email',
560
-							'name'    => __( 'From Email', 'give' ),
561
-							'desc'    => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
562
-							'default' => get_bloginfo( 'admin_email' ),
560
+							'name'    => __('From Email', 'give'),
561
+							'desc'    => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
562
+							'default' => get_bloginfo('admin_email'),
563 563
 							'type'    => 'text',
564 564
 						),
565 565
 						array(
566
-							'name' => __( 'Donation Receipt', 'give' ),
566
+							'name' => __('Donation Receipt', 'give'),
567 567
 							'desc' => '',
568 568
 							'id'   => 'give_title_email_settings_2',
569 569
 							'type' => 'give_title',
570 570
 						),
571 571
 						array(
572 572
 							'id'      => 'donation_subject',
573
-							'name'    => __( 'Donation Email Subject', 'give' ),
574
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
575
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
573
+							'name'    => __('Donation Email Subject', 'give'),
574
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
575
+							'default' => esc_attr__('Donation Receipt', 'give'),
576 576
 							'type'    => 'text',
577 577
 						),
578 578
 						array(
579 579
 							'id'      => 'donation_receipt',
580
-							'name'    => __( 'Donation Receipt', 'give' ),
580
+							'name'    => __('Donation Receipt', 'give'),
581 581
 							'desc'    => sprintf(
582 582
 								/* translators: %s: emails tags list */
583
-								__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ),
584
-								'<br/>' . give_get_emails_tags_list()
583
+								__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'),
584
+								'<br/>'.give_get_emails_tags_list()
585 585
 							),
586 586
 							'type'    => 'wysiwyg',
587 587
 							'default' => give_get_default_donation_receipt_email(),
588 588
 						),
589 589
 						array(
590
-							'name' => __( 'New Donation Notification', 'give' ),
590
+							'name' => __('New Donation Notification', 'give'),
591 591
 							'desc' => '',
592 592
 							'id'   => 'give_title_email_settings_3',
593 593
 							'type' => 'give_title',
594 594
 						),
595 595
 						array(
596 596
 							'id'      => 'donation_notification_subject',
597
-							'name'    => __( 'Donation Notification Subject', 'give' ),
598
-							'desc'    => __( 'Enter the subject line for the donation notification email.', 'give' ),
597
+							'name'    => __('Donation Notification Subject', 'give'),
598
+							'desc'    => __('Enter the subject line for the donation notification email.', 'give'),
599 599
 							'type'    => 'text',
600
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' ),
600
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give'),
601 601
 						),
602 602
 						array(
603 603
 							'id'      => 'donation_notification',
604
-							'name'    => __( 'Donation Notification', 'give' ),
604
+							'name'    => __('Donation Notification', 'give'),
605 605
 							'desc'    => sprintf(
606 606
 								/* translators: %s: emails tags list */
607
-								__( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ),
608
-								'<br/>' . give_get_emails_tags_list()
607
+								__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'),
608
+								'<br/>'.give_get_emails_tags_list()
609 609
 							),
610 610
 							'type'    => 'wysiwyg',
611 611
 							'default' => give_get_default_donation_notification_email(),
612 612
 						),
613 613
 						array(
614 614
 							'id'      => 'admin_notice_emails',
615
-							'name'    => __( 'Donation Notification Emails', 'give' ),
616
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
615
+							'name'    => __('Donation Notification Emails', 'give'),
616
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
617 617
 							'type'    => 'textarea',
618
-							'default' => get_bloginfo( 'admin_email' ),
618
+							'default' => get_bloginfo('admin_email'),
619 619
 						),
620 620
 						array(
621 621
 							'id'   => 'disable_admin_notices',
622
-							'name' => __( 'Disable Admin Notifications', 'give' ),
623
-							'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
622
+							'name' => __('Disable Admin Notifications', 'give'),
623
+							'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'),
624 624
 							'type' => 'checkbox',
625 625
 						),
626 626
 					)
@@ -629,99 +629,99 @@  discard block
 block discarded – undo
629 629
 			/** Extension Settings */
630 630
 			'addons'      => array(
631 631
 				'id'         => 'addons',
632
-				'give_title' => __( 'Give Add-ons Settings', 'give' ),
633
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
634
-				'fields'     => apply_filters( 'give_settings_addons', array()
632
+				'give_title' => __('Give Add-ons Settings', 'give'),
633
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
634
+				'fields'     => apply_filters('give_settings_addons', array()
635 635
 				),
636 636
 			),
637 637
 			/** Licenses Settings */
638 638
 			'licenses'    => array(
639 639
 				'id'         => 'licenses',
640
-				'give_title' => __( 'Give Licenses', 'give' ),
641
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
642
-				'fields'     => apply_filters( 'give_settings_licenses', array()
640
+				'give_title' => __('Give Licenses', 'give'),
641
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
642
+				'fields'     => apply_filters('give_settings_licenses', array()
643 643
 				),
644 644
 			),
645 645
 			/** Advanced Options */
646 646
 			'advanced'    => array(
647 647
 				'id'         => 'advanced_options',
648
-				'give_title' => __( 'Advanced Options', 'give' ),
649
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
650
-				'fields'     => apply_filters( 'give_settings_advanced', array(
648
+				'give_title' => __('Advanced Options', 'give'),
649
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
650
+				'fields'     => apply_filters('give_settings_advanced', array(
651 651
 						array(
652
-							'name' => __( 'Access Control', 'give' ),
652
+							'name' => __('Access Control', 'give'),
653 653
 							'desc' => '',
654 654
 							'id'   => 'give_title_session_control_1',
655 655
 							'type' => 'give_title',
656 656
 						),
657 657
 						array(
658 658
 							'id'      => 'session_lifetime',
659
-							'name'    => __( 'Session Lifetime', 'give' ),
660
-							'desc'    => __( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
659
+							'name'    => __('Session Lifetime', 'give'),
660
+							'desc'    => __('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
661 661
 							'type'    => 'select',
662 662
 							'options' => array(
663
-								'86400'  => __( '24 Hours', 'give' ),
664
-								'172800' => __( '48 Hours', 'give' ),
665
-								'259200' => __( '72 Hours', 'give' ),
666
-								'604800' => __( '1 Week', 'give' ),
663
+								'86400'  => __('24 Hours', 'give'),
664
+								'172800' => __('48 Hours', 'give'),
665
+								'259200' => __('72 Hours', 'give'),
666
+								'604800' => __('1 Week', 'give'),
667 667
 							),
668 668
 						),
669 669
 						array(
670
-							'name' => __( 'Email Access', 'give' ),
671
-							'desc' => __( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
670
+							'name' => __('Email Access', 'give'),
671
+							'desc' => __('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
672 672
 							'id'   => 'email_access',
673 673
 							'type' => 'checkbox',
674 674
 						),
675 675
 						array(
676 676
 							'id'      => 'recaptcha_key',
677
-							'name'    => __( 'reCAPTCHA Site Key', 'give' ),
677
+							'name'    => __('reCAPTCHA Site Key', 'give'),
678 678
 							/* translators: %s: https://www.google.com/recaptcha/ */
679
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ),
679
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')),
680 680
 							'default' => '',
681 681
 							'type'    => 'text',
682 682
 						),
683 683
 						array(
684 684
 							'id'      => 'recaptcha_secret',
685
-							'name'    => __( 'reCAPTCHA Secret Key', 'give' ),
686
-							'desc'    => __( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
685
+							'name'    => __('reCAPTCHA Secret Key', 'give'),
686
+							'desc'    => __('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
687 687
 							'default' => '',
688 688
 							'type'    => 'text',
689 689
 						),
690 690
 						array(
691
-							'name' => __( 'Data Control', 'give' ),
691
+							'name' => __('Data Control', 'give'),
692 692
 							'desc' => '',
693 693
 							'id'   => 'give_title_data_control_2',
694 694
 							'type' => 'give_title',
695 695
 						),
696 696
 						array(
697
-							'name' => __( 'Remove All Data on Uninstall?', 'give' ),
698
-							'desc' => __( 'When the plugin is deleted, completely remove all Give data.', 'give' ),
697
+							'name' => __('Remove All Data on Uninstall?', 'give'),
698
+							'desc' => __('When the plugin is deleted, completely remove all Give data.', 'give'),
699 699
 							'id'   => 'uninstall_on_delete',
700 700
 							'type' => 'checkbox',
701 701
 						),
702 702
 						array(
703
-							'name' => __( 'Filter Control', 'give' ),
703
+							'name' => __('Filter Control', 'give'),
704 704
 							'desc' => '',
705 705
 							'id'   => 'give_title_filter_control',
706 706
 							'type' => 'give_title',
707 707
 						),
708 708
 						array(
709 709
 							/* translators: %s: the_content */
710
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
710
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
711 711
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
712
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
712
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
713 713
 							'id'   => 'disable_the_content_filter',
714 714
 							'type' => 'checkbox',
715 715
 						),
716 716
 						array(
717
-							'name' => __( 'Script Loading', 'give' ),
717
+							'name' => __('Script Loading', 'give'),
718 718
 							'desc' => '',
719 719
 							'id'   => 'give_title_script_control',
720 720
 							'type' => 'give_title',
721 721
 						),
722 722
 						array(
723
-							'name' => __( 'Load Scripts in Footer?', 'give' ),
724
-							'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
723
+							'name' => __('Load Scripts in Footer?', 'give'),
724
+							'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
725 725
 							'id'   => 'scripts_footer',
726 726
 							'type' => 'checkbox',
727 727
 						),
@@ -731,13 +731,13 @@  discard block
 block discarded – undo
731 731
 			/** API Settings */
732 732
 			'api'         => array(
733 733
 				'id'         => 'api',
734
-				'give_title' => __( 'API', 'give' ),
735
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
734
+				'give_title' => __('API', 'give'),
735
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
736 736
 				'show_names' => false, // Hide field names on the left
737
-				'fields'     => apply_filters( 'give_settings_system', array(
737
+				'fields'     => apply_filters('give_settings_system', array(
738 738
 						array(
739 739
 							'id'   => 'api',
740
-							'name' => __( 'API', 'give' ),
740
+							'name' => __('API', 'give'),
741 741
 							'type' => 'api',
742 742
 						),
743 743
 					)
@@ -746,13 +746,13 @@  discard block
 block discarded – undo
746 746
 			/** Licenses Settings */
747 747
 			'system_info' => array(
748 748
 				'id'         => 'system_info',
749
-				'give_title' => __( 'System Info', 'give' ),
750
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
751
-				'fields'     => apply_filters( 'give_settings_system', array(
749
+				'give_title' => __('System Info', 'give'),
750
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
751
+				'fields'     => apply_filters('give_settings_system', array(
752 752
 						array(
753 753
 							'id'   => 'system-info-textarea',
754
-							'name' => __( 'System Info', 'give' ),
755
-							'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
754
+							'name' => __('System Info', 'give'),
755
+							'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'),
756 756
 							'type' => 'system_info',
757 757
 						),
758 758
 					)
@@ -760,15 +760,15 @@  discard block
 block discarded – undo
760 760
 			),
761 761
 		);
762 762
 
763
-		$give_settings = apply_filters( 'give_registered_settings', $give_settings );
763
+		$give_settings = apply_filters('give_registered_settings', $give_settings);
764 764
 
765 765
 		// Return all settings array if no active tab
766
-		if ( empty( $active_tab ) || ! isset( $give_settings[ $active_tab ] ) ) {
766
+		if (empty($active_tab) || ! isset($give_settings[$active_tab])) {
767 767
 			return $give_settings;
768 768
 		}
769 769
 
770 770
 		// Add other tabs and settings fields as needed
771
-		return $give_settings[ $active_tab ];
771
+		return $give_settings[$active_tab];
772 772
 
773 773
 	}
774 774
 
@@ -777,11 +777,11 @@  discard block
 block discarded – undo
777 777
 	 */
778 778
 	public function settings_notices() {
779 779
 
780
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
780
+		if ( ! isset($_POST['give_settings_saved'])) {
781 781
 			return;
782 782
 		}
783 783
 
784
-		add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' );
784
+		add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated');
785 785
 
786 786
 	}
787 787
 
@@ -796,14 +796,14 @@  discard block
 block discarded – undo
796 796
 	 * @return mixed         Field value or exception is thrown.
797 797
 	 * @throws Exception     Throws an exception if the field is invalid.
798 798
 	 */
799
-	public function __get( $field ) {
799
+	public function __get($field) {
800 800
 
801 801
 		// Allowed fields to retrieve
802
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
802
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
803 803
 			return $this->{$field};
804 804
 		}
805 805
 
806
-		throw new Exception( sprintf( __( 'Invalid property: %s', 'give' ), $field ) );
806
+		throw new Exception(sprintf(__('Invalid property: %s', 'give'), $field));
807 807
 	}
808 808
 
809 809
 
@@ -822,12 +822,12 @@  discard block
 block discarded – undo
822 822
  *
823 823
  * @return mixed        Option value
824 824
  */
825
-function give_get_option( $key = '', $default = false ) {
825
+function give_get_option($key = '', $default = false) {
826 826
 	$give_options = give_get_settings();
827
-	$value        = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
828
-	$value        = apply_filters( 'give_get_option', $value, $key, $default );
827
+	$value        = ! empty($give_options[$key]) ? $give_options[$key] : $default;
828
+	$value        = apply_filters('give_get_option', $value, $key, $default);
829 829
 
830
-	return apply_filters( "give_get_option_{$key}", $value, $key, $default );
830
+	return apply_filters("give_get_option_{$key}", $value, $key, $default);
831 831
 }
832 832
 
833 833
 
@@ -845,33 +845,33 @@  discard block
 block discarded – undo
845 845
  *
846 846
  * @return boolean True if updated, false if not.
847 847
  */
848
-function give_update_option( $key = '', $value = false ) {
848
+function give_update_option($key = '', $value = false) {
849 849
 
850 850
 	// If no key, exit
851
-	if ( empty( $key ) ) {
851
+	if (empty($key)) {
852 852
 		return false;
853 853
 	}
854 854
 
855
-	if ( empty( $value ) ) {
856
-		$remove_option = give_delete_option( $key );
855
+	if (empty($value)) {
856
+		$remove_option = give_delete_option($key);
857 857
 
858 858
 		return $remove_option;
859 859
 	}
860 860
 
861 861
 	// First let's grab the current settings
862
-	$options = get_option( 'give_settings' );
862
+	$options = get_option('give_settings');
863 863
 
864 864
 	// Let's let devs alter that value coming in
865
-	$value = apply_filters( 'give_update_option', $value, $key );
865
+	$value = apply_filters('give_update_option', $value, $key);
866 866
 
867 867
 	// Next let's try to update the value
868
-	$options[ $key ] = $value;
869
-	$did_update      = update_option( 'give_settings', $options );
868
+	$options[$key] = $value;
869
+	$did_update      = update_option('give_settings', $options);
870 870
 
871 871
 	// If it updated, let's update the global variable
872
-	if ( $did_update ) {
872
+	if ($did_update) {
873 873
 		global $give_options;
874
-		$give_options[ $key ] = $value;
874
+		$give_options[$key] = $value;
875 875
 	}
876 876
 
877 877
 	return $did_update;
@@ -890,25 +890,25 @@  discard block
 block discarded – undo
890 890
  *
891 891
  * @return boolean True if updated, false if not.
892 892
  */
893
-function give_delete_option( $key = '' ) {
893
+function give_delete_option($key = '') {
894 894
 
895 895
 	// If no key, exit
896
-	if ( empty( $key ) ) {
896
+	if (empty($key)) {
897 897
 		return false;
898 898
 	}
899 899
 
900 900
 	// First let's grab the current settings
901
-	$options = get_option( 'give_settings' );
901
+	$options = get_option('give_settings');
902 902
 
903 903
 	// Next let's try to update the value
904
-	if ( isset( $options[ $key ] ) ) {
905
-		unset( $options[ $key ] );
904
+	if (isset($options[$key])) {
905
+		unset($options[$key]);
906 906
 	}
907 907
 
908
-	$did_update = update_option( 'give_settings', $options );
908
+	$did_update = update_option('give_settings', $options);
909 909
 
910 910
 	// If it updated, let's update the global variable
911
-	if ( $did_update ) {
911
+	if ($did_update) {
912 912
 		global $give_options;
913 913
 		$give_options = $options;
914 914
 	}
@@ -927,9 +927,9 @@  discard block
 block discarded – undo
927 927
  */
928 928
 function give_get_settings() {
929 929
 
930
-	$settings = get_option( 'give_settings' );
930
+	$settings = get_option('give_settings');
931 931
 
932
-	return (array) apply_filters( 'give_get_settings', $settings );
932
+	return (array) apply_filters('give_get_settings', $settings);
933 933
 
934 934
 }
935 935
 
@@ -947,25 +947,25 @@  discard block
 block discarded – undo
947 947
  *
948 948
  * @return array
949 949
  */
950
-function give_settings_array_insert( $array, $position, $insert ) {
951
-	if ( is_int( $position ) ) {
952
-		array_splice( $array, $position, 0, $insert );
950
+function give_settings_array_insert($array, $position, $insert) {
951
+	if (is_int($position)) {
952
+		array_splice($array, $position, 0, $insert);
953 953
 	} else {
954 954
 
955
-		foreach ( $array as $index => $subarray ) {
956
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
955
+		foreach ($array as $index => $subarray) {
956
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
957 957
 				$pos = $index;
958 958
 			}
959 959
 		}
960 960
 
961
-		if ( ! isset( $pos ) ) {
961
+		if ( ! isset($pos)) {
962 962
 			return $array;
963 963
 		}
964 964
 
965 965
 		$array = array_merge(
966
-			array_slice( $array, 0, $pos ),
966
+			array_slice($array, 0, $pos),
967 967
 			$insert,
968
-			array_slice( $array, $pos )
968
+			array_slice($array, $pos)
969 969
 		);
970 970
 	}
971 971
 
@@ -985,23 +985,23 @@  discard block
 block discarded – undo
985 985
  *
986 986
  * @return void
987 987
  */
988
-function give_enabled_gateways_callback( $field_arr, $saved_values = array() ) {
988
+function give_enabled_gateways_callback($field_arr, $saved_values = array()) {
989 989
 
990 990
 	$id       = $field_arr['id'];
991
-	$gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() );
991
+	$gateways = give_get_ordered_payment_gateways(give_get_payment_gateways());
992 992
 
993 993
 	echo '<ul class="give-checklist-fields give-payment-gatways-list">';
994 994
 
995
-	foreach ( $gateways as $key => $option ) :
995
+	foreach ($gateways as $key => $option) :
996 996
 
997
-		if ( is_array( $saved_values ) && array_key_exists( $key, $saved_values ) ) {
997
+		if (is_array($saved_values) && array_key_exists($key, $saved_values)) {
998 998
 			$enabled = '1';
999 999
 		} else {
1000 1000
 			$enabled = null;
1001 1001
 		}
1002 1002
 
1003
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
1004
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
1003
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
1004
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
1005 1005
 
1006 1006
 	endforeach;
1007 1007
 
@@ -1020,16 +1020,16 @@  discard block
 block discarded – undo
1020 1020
  *
1021 1021
  * @return void
1022 1022
  */
1023
-function give_default_gateway_callback( $field_arr, $saved_value ) {
1023
+function give_default_gateway_callback($field_arr, $saved_value) {
1024 1024
 	$id          = $field_arr['id'];
1025 1025
 	$gateways    = give_get_enabled_payment_gateways();
1026
-	$saved_value = give_get_default_gateway( null );
1026
+	$saved_value = give_get_default_gateway(null);
1027 1027
 
1028
-	echo '<select class="give-select" name="' . $id . '" id="' . $id . '">';
1028
+	echo '<select class="give-select" name="'.$id.'" id="'.$id.'">';
1029 1029
 
1030
-	foreach ( $gateways as $key => $option ) :
1031
-		$selected = isset( $saved_value ) ? selected( $key, $saved_value, false ) : '';
1032
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1030
+	foreach ($gateways as $key => $option) :
1031
+		$selected = isset($saved_value) ? selected($key, $saved_value, false) : '';
1032
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1033 1033
 	endforeach;
1034 1034
 
1035 1035
 	echo '</select>';
@@ -1047,13 +1047,13 @@  discard block
 block discarded – undo
1047 1047
  *
1048 1048
  * @return void
1049 1049
  */
1050
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1050
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1051 1051
 
1052 1052
 	$id                = $field_type_object->field->args['id'];
1053 1053
 	$title             = $field_type_object->field->args['name'];
1054 1054
 	$field_description = $field_type_object->field->args['desc'];
1055 1055
 
1056
-	echo '<hr>' . $field_description;
1056
+	echo '<hr>'.$field_description;
1057 1057
 
1058 1058
 }
1059 1059
 
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
  *
1069 1069
  * @return void
1070 1070
  */
1071
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1071
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1072 1072
 
1073 1073
 	$id                = $field_type_object->field->args['id'];
1074 1074
 	$title             = $field_type_object->field->args['name'];
@@ -1087,25 +1087,25 @@  discard block
 block discarded – undo
1087 1087
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1088 1088
  * @return array An array of options that matches the CMB2 options array
1089 1089
  */
1090
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1090
+function give_cmb2_get_post_options($query_args, $force = false) {
1091 1091
 
1092
-	$post_options = array( '' => '' ); // Blank option
1092
+	$post_options = array('' => ''); // Blank option
1093 1093
 
1094
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1094
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1095 1095
 		return $post_options;
1096 1096
 	}
1097 1097
 
1098
-	$args = wp_parse_args( $query_args, array(
1098
+	$args = wp_parse_args($query_args, array(
1099 1099
 		'post_type'   => 'page',
1100 1100
 		'numberposts' => 10,
1101
-	) );
1101
+	));
1102 1102
 
1103
-	$posts = get_posts( $args );
1103
+	$posts = get_posts($args);
1104 1104
 
1105
-	if ( $posts ) {
1106
-		foreach ( $posts as $post ) {
1105
+	if ($posts) {
1106
+		foreach ($posts as $post) {
1107 1107
 
1108
-			$post_options[ $post->ID ] = $post->post_title;
1108
+			$post_options[$post->ID] = $post->post_title;
1109 1109
 
1110 1110
 		}
1111 1111
 	}
@@ -1130,33 +1130,33 @@  discard block
 block discarded – undo
1130 1130
 
1131 1131
 	$sizes     = array();
1132 1132
 	$get_sizes = get_intermediate_image_sizes();
1133
-	$core_image_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
1133
+	$core_image_sizes = array('thumbnail', 'medium', 'medium_large', 'large');
1134 1134
 
1135 1135
 
1136 1136
 	// This will help us to filter special characters from a string
1137
-	$filter_slug_items = array( '_', '-' );
1137
+	$filter_slug_items = array('_', '-');
1138 1138
 
1139
-	foreach ( $get_sizes as $_size ) {
1139
+	foreach ($get_sizes as $_size) {
1140 1140
 
1141 1141
 		// Converting image size slug to title case
1142
-		$sizes[ $_size ] = give_slug_to_title( $_size, $filter_slug_items );
1142
+		$sizes[$_size] = give_slug_to_title($_size, $filter_slug_items);
1143 1143
 
1144
-		if ( in_array( $_size, $core_image_sizes ) ) {
1145
-			$sizes[ $_size ] .= ' (' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1146
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1147
-			$sizes[ $_size ] .= " ({$_wp_additional_image_sizes[ $_size ]['width']} x {$_wp_additional_image_sizes[ $_size ]['height']}";
1144
+		if (in_array($_size, $core_image_sizes)) {
1145
+			$sizes[$_size] .= ' ('.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1146
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1147
+			$sizes[$_size] .= " ({$_wp_additional_image_sizes[$_size]['width']} x {$_wp_additional_image_sizes[$_size]['height']}";
1148 1148
 		}
1149 1149
 
1150 1150
 		// Based on the above image height check, label the respective resolution as responsive
1151
-		if ( ( array_key_exists( $_size, $_wp_additional_image_sizes ) && ! $_wp_additional_image_sizes[ $_size ]['crop'] ) || ( in_array( $_size, $core_image_sizes ) && ! get_option( "{$_size}_crop" ) ) ) {
1152
-			$sizes[ $_size ] .= ' - responsive';
1151
+		if ((array_key_exists($_size, $_wp_additional_image_sizes) && ! $_wp_additional_image_sizes[$_size]['crop']) || (in_array($_size, $core_image_sizes) && ! get_option("{$_size}_crop"))) {
1152
+			$sizes[$_size] .= ' - responsive';
1153 1153
 		}
1154 1154
 
1155
-		$sizes[ $_size ] .= ')';
1155
+		$sizes[$_size] .= ')';
1156 1156
 
1157 1157
 	}
1158 1158
 
1159
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1159
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1160 1160
 }
1161 1161
 
1162 1162
 
@@ -1172,14 +1172,14 @@  discard block
 block discarded – undo
1172 1172
  *
1173 1173
  *  @return text $string
1174 1174
  */
1175
-function give_slug_to_title( $string, $filters = array() ){
1175
+function give_slug_to_title($string, $filters = array()) {
1176 1176
 
1177
-    foreach( $filters as $filter_item ){
1178
-        $string = str_replace( $filter_item, ' ', $string );
1177
+    foreach ($filters as $filter_item) {
1178
+        $string = str_replace($filter_item, ' ', $string);
1179 1179
     }
1180 1180
 
1181 1181
     // Return updated string after converting it to title case
1182
-    return ucwords( $string );
1182
+    return ucwords($string);
1183 1183
 
1184 1184
 }
1185 1185
 
@@ -1195,18 +1195,18 @@  discard block
 block discarded – undo
1195 1195
  *
1196 1196
  * @return void
1197 1197
  */
1198
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1198
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1199 1199
 	/* @var CMB2_Types $field_type_object */
1200 1200
 
1201 1201
 	$id                 = $field_type_object->field->args['id'];
1202 1202
 	$field_description  = $field_type_object->field->args['desc'];
1203 1203
 	$license            = $field_type_object->field->args['options']['license'];
1204 1204
 	$license_key        = $escaped_value;
1205
-	$is_license_key     = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1206
-	$is_valid_license   = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1205
+	$is_license_key     = apply_filters('give_is_license_key', (is_object($license) && ! empty($license)));
1206
+	$is_valid_license   = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license));
1207 1207
 	$shortname          = $field_type_object->field->args['options']['shortname'];
1208 1208
 	$field_classes      = 'regular-text give-license-field';
1209
-	$type               = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password';
1209
+	$type               = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password';
1210 1210
 	$custom_html        = '';
1211 1211
 	$messages           = array();
1212 1212
 	$class              = '';
@@ -1218,145 +1218,145 @@  discard block
 block discarded – undo
1218 1218
 
1219 1219
 	// By default query on edd api url will return license object which contain status and message property, this can break below functionality.
1220 1220
 	// To combat that check if status is set to error or not, if yes then set $is_license_key to false.
1221
-	if ( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) {
1221
+	if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) {
1222 1222
 		$is_license_key = false;
1223 1223
 	}
1224 1224
 
1225 1225
 	// Check if current license is part of subscription or not.
1226
-	$subscriptions = get_option( 'give_subscriptions' );
1226
+	$subscriptions = get_option('give_subscriptions');
1227 1227
 
1228
-	if ( $is_license_key && $subscriptions ) {
1229
-		foreach ( $subscriptions as $subscription ) {
1230
-			if ( in_array( $license_key, $subscription['licenses'] ) ) {
1228
+	if ($is_license_key && $subscriptions) {
1229
+		foreach ($subscriptions as $subscription) {
1230
+			if (in_array($license_key, $subscription['licenses'])) {
1231 1231
 				$is_in_subscription = $subscription['id'];
1232 1232
 				break;
1233 1233
 			}
1234 1234
 		}
1235 1235
 	}
1236 1236
 
1237
-	if ( $is_license_key ) {
1238
-		if ( $is_in_subscription ) {
1239
-			$subscription_expires = strtotime( $subscriptions[ $is_in_subscription ]['expires'] );
1240
-			$subscription_status  = __( 'renew', 'give' );
1237
+	if ($is_license_key) {
1238
+		if ($is_in_subscription) {
1239
+			$subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']);
1240
+			$subscription_status  = __('renew', 'give');
1241 1241
 
1242
-			if ( ( 'active' !== $subscriptions[ $is_in_subscription ]['status'] ) ) {
1243
-				$subscription_status = __( 'expire', 'give' );
1242
+			if (('active' !== $subscriptions[$is_in_subscription]['status'])) {
1243
+				$subscription_status = __('expire', 'give');
1244 1244
 			}
1245 1245
 
1246
-			if ( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1247
-				$messages[]     = sprintf(
1248
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1249
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1250
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1251
-					$checkout_page_link . '?edd_license_key=' . $subscriptions[ $is_in_subscription ]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1246
+			if ($subscription_expires < current_time('timestamp', 1)) {
1247
+				$messages[] = sprintf(
1248
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'),
1249
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1250
+					$subscriptions[$is_in_subscription]['payment_id'],
1251
+					$checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1252 1252
 				);
1253 1253
 				$license_status = 'license-expired';
1254
-			} elseif ( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1254
+			} elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) {
1255 1255
 				$messages[]     = sprintf(
1256
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give' ),
1257
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1258
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1256
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give'),
1257
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1258
+					$subscriptions[$is_in_subscription]['payment_id'],
1259 1259
 					$subscription_status,
1260
-					human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[ $is_in_subscription ]['expires'] ) )
1260
+					human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires']))
1261 1261
 				);
1262 1262
 				$license_status = 'license-expires-soon';
1263 1263
 			} else {
1264 1264
 				$messages[]     = sprintf(
1265
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give' ),
1266
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1267
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1265
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give'),
1266
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1267
+					$subscriptions[$is_in_subscription]['payment_id'],
1268 1268
 					$subscription_status,
1269
-					date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[ $is_in_subscription ]['expires'], current_time( 'timestamp' ) ) )
1269
+					date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp')))
1270 1270
 				);
1271 1271
 				$license_status = 'license-expiration-date';
1272 1272
 			}
1273
-		} elseif ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1273
+		} elseif (empty($license->success) && property_exists($license, 'error')) {
1274 1274
 
1275 1275
 			// activate_license 'invalid' on anything other than valid, so if there was an error capture it
1276
-			switch ( $license->error ) {
1276
+			switch ($license->error) {
1277 1277
 				case 'expired' :
1278 1278
 					$class          = $license->error;
1279 1279
 					$messages[]     = sprintf(
1280
-						__( 'Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ),
1281
-						date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1282
-						$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1280
+						__('Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give'),
1281
+						date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1282
+						$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1283 1283
 					);
1284
-					$license_status = 'license-' . $class;
1284
+					$license_status = 'license-'.$class;
1285 1285
 					break;
1286 1286
 
1287 1287
 				case 'missing' :
1288 1288
 					$class          = $license->error;
1289 1289
 					$messages[]     = sprintf(
1290
-						__( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ),
1291
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1290
+						__('Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give'),
1291
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1292 1292
 					);
1293
-					$license_status = 'license-' . $class;
1293
+					$license_status = 'license-'.$class;
1294 1294
 					break;
1295 1295
 
1296 1296
 				case 'invalid' :
1297 1297
 					$class          = $license->error;
1298 1298
 					$messages[]     = sprintf(
1299
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1299
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1300 1300
 						$addon_name,
1301
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1301
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1302 1302
 					);
1303
-					$license_status = 'license-' . $class;
1303
+					$license_status = 'license-'.$class;
1304 1304
 					break;
1305 1305
 
1306 1306
 				case 'site_inactive' :
1307 1307
 					$class          = $license->error;
1308 1308
 					$messages[]     = sprintf(
1309
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1309
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1310 1310
 						$addon_name,
1311
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1311
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1312 1312
 					);
1313
-					$license_status = 'license-' . $class;
1313
+					$license_status = 'license-'.$class;
1314 1314
 					break;
1315 1315
 
1316 1316
 				case 'item_name_mismatch' :
1317 1317
 					$class          = $license->error;
1318
-					$messages[]     = sprintf( __( 'This license %1$s does not belong to %2$s.', 'give' ), $license_key, $addon_name );
1319
-					$license_status = 'license-' . $class;
1318
+					$messages[]     = sprintf(__('This license %1$s does not belong to %2$s.', 'give'), $license_key, $addon_name);
1319
+					$license_status = 'license-'.$class;
1320 1320
 					break;
1321 1321
 
1322 1322
 				case 'no_activations_left':
1323 1323
 					$class          = $license->error;
1324
-					$messages[]     = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1325
-					$license_status = 'license-' . $class;
1324
+					$messages[]     = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link);
1325
+					$license_status = 'license-'.$class;
1326 1326
 					break;
1327 1327
 			}
1328 1328
 
1329
-		} elseif ( empty( $license->success ) ){
1329
+		} elseif (empty($license->success)) {
1330 1330
 			$class          = 'invalid';
1331 1331
 			$messages[]     = sprintf(
1332
-				__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1332
+				__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1333 1333
 				$addon_name,
1334
-				$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1334
+				$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1335 1335
 			);
1336
-			$license_status = 'license-' . $class;
1336
+			$license_status = 'license-'.$class;
1337 1337
 
1338
-		}else {
1339
-			switch ( $license->license ) {
1338
+		} else {
1339
+			switch ($license->license) {
1340 1340
 				case 'valid' :
1341 1341
 				default:
1342 1342
 					$class      = 'valid';
1343
-					$now        = current_time( 'timestamp' );
1344
-					$expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1343
+					$now        = current_time('timestamp');
1344
+					$expiration = strtotime($license->expires, current_time('timestamp'));
1345 1345
 
1346
-					if ( 'lifetime' === $license->expires ) {
1347
-						$messages[]     = __( 'License key never expires.', 'give' );
1346
+					if ('lifetime' === $license->expires) {
1347
+						$messages[]     = __('License key never expires.', 'give');
1348 1348
 						$license_status = 'license-lifetime-notice';
1349
-					} elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1349
+					} elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) {
1350 1350
 						$messages[]     = sprintf(
1351
-							__( 'Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1352
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1353
-							$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1351
+							__('Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'),
1352
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1353
+							$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1354 1354
 						);
1355 1355
 						$license_status = 'license-expires-soon';
1356 1356
 					} else {
1357 1357
 						$messages[]     = sprintf(
1358
-							__( 'Your license key expires on %s.', 'give' ),
1359
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1358
+							__('Your license key expires on %s.', 'give'),
1359
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp')))
1360 1360
 						);
1361 1361
 						$license_status = 'license-expiration-date';
1362 1362
 					}
@@ -1364,15 +1364,15 @@  discard block
 block discarded – undo
1364 1364
 			}
1365 1365
 		}
1366 1366
 	} else {
1367
-		$messages[]     = sprintf(
1368
-			__( 'To receive updates, please enter your valid %s license key.', 'give' ),
1367
+		$messages[] = sprintf(
1368
+			__('To receive updates, please enter your valid %s license key.', 'give'),
1369 1369
 			$addon_name
1370 1370
 		);
1371 1371
 		$license_status = 'inactive';
1372 1372
 	}
1373 1373
 
1374 1374
 	// Add class for input field if license is active.
1375
-	if ( $is_valid_license ) {
1375
+	if ($is_valid_license) {
1376 1376
 		$field_classes .= ' give-license-active';
1377 1377
 	}
1378 1378
 
@@ -1380,33 +1380,33 @@  discard block
 block discarded – undo
1380 1380
 	$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\">";
1381 1381
 
1382 1382
 	// If license is active so show deactivate button.
1383
-	if ( $is_valid_license ) {
1383
+	if ($is_valid_license) {
1384 1384
 		// Get input field html.
1385 1385
 		$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\" readonly=\"readonly\">";
1386 1386
 
1387
-		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1387
+		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1388 1388
 
1389 1389
 	}
1390 1390
 
1391 1391
 	// Field description.
1392
-	$custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1392
+	$custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1393 1393
 
1394 1394
 	// If no messages found then inform user that to get updated in future register yourself.
1395
-	if ( empty( $messages ) ) {
1396
-		$messages[] = apply_filters( "{$shortname}_default_addon_notice", __( 'To receive updates, please enter your valid license key.', 'give' ) );
1395
+	if (empty($messages)) {
1396
+		$messages[] = apply_filters("{$shortname}_default_addon_notice", __('To receive updates, please enter your valid license key.', 'give'));
1397 1397
 	}
1398 1398
 
1399
-	foreach ( $messages as $message ) {
1400
-		$custom_html .= '<div class="give-license-status-notice give-' . $license_status . '">';
1401
-		$custom_html .= '<p>' . $message . '</p>';
1399
+	foreach ($messages as $message) {
1400
+		$custom_html .= '<div class="give-license-status-notice give-'.$license_status.'">';
1401
+		$custom_html .= '<p>'.$message.'</p>';
1402 1402
 		$custom_html .= '</div>';
1403 1403
 	}
1404 1404
 
1405 1405
 	// Field html.
1406
-	$custom_html = apply_filters( 'give_license_key_field_html', $input_field_html . $custom_html, $field_type_object );
1406
+	$custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object);
1407 1407
 
1408 1408
 	// Nonce.
1409
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1409
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1410 1410
 
1411 1411
 	// Print field html.
1412 1412
 	echo "<div class=\"give-license-key\"><label for=\"{$id}\">{$addon_name }</label></div><div class=\"give-license-block\">{$custom_html}</div>";
@@ -1421,7 +1421,7 @@  discard block
 block discarded – undo
1421 1421
  */
1422 1422
 function give_api_callback() {
1423 1423
 
1424
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1424
+	if ( ! current_user_can('manage_give_settings')) {
1425 1425
 		return;
1426 1426
 	}
1427 1427
 
@@ -1430,9 +1430,9 @@  discard block
 block discarded – undo
1430 1430
 	 *
1431 1431
 	 * @since 1.0
1432 1432
 	 */
1433
-	do_action( 'give_tools_api_keys_before' );
1433
+	do_action('give_tools_api_keys_before');
1434 1434
 
1435
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1435
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1436 1436
 
1437 1437
 	$api_keys_table = new Give_API_Keys_Table();
1438 1438
 	$api_keys_table->prepare_items();
@@ -1441,9 +1441,9 @@  discard block
 block discarded – undo
1441 1441
 	<span class="cmb2-metabox-description api-description">
1442 1442
 		<?php echo sprintf(
1443 1443
 			/* translators: 1: http://docs.givewp.com/api 2: http://docs.givewp.com/addon-zapier */
1444
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1445
-			esc_url( 'http://docs.givewp.com/api' ),
1446
-			esc_url( 'http://docs.givewp.com/addon-zapier' )
1444
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1445
+			esc_url('http://docs.givewp.com/api'),
1446
+			esc_url('http://docs.givewp.com/addon-zapier')
1447 1447
 		); ?>
1448 1448
 	</span>
1449 1449
 	<?php
@@ -1453,10 +1453,10 @@  discard block
 block discarded – undo
1453 1453
 	 *
1454 1454
 	 * @since 1.0
1455 1455
 	 */
1456
-	do_action( 'give_tools_api_keys_after' );
1456
+	do_action('give_tools_api_keys_after');
1457 1457
 }
1458 1458
 
1459
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1459
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1460 1460
 
1461 1461
 /**
1462 1462
  * Hook Callback
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
  *
1470 1470
  * @return void
1471 1471
  */
1472
-function give_hook_callback( $args ) {
1472
+function give_hook_callback($args) {
1473 1473
 
1474 1474
 	$id = $args['id'];
1475 1475
 
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
 	 *
1479 1479
 	 * @since 1.0
1480 1480
 	 */
1481
-	do_action( "give_{$id}" );
1481
+	do_action("give_{$id}");
1482 1482
 
1483 1483
 }
1484 1484
 
@@ -1493,19 +1493,19 @@  discard block
 block discarded – undo
1493 1493
  *
1494 1494
  * @return bool
1495 1495
  */
1496
-function give_is_setting_enabled( $value, $compare_with = null ) {
1497
-	if ( ! is_null( $compare_with ) ) {
1496
+function give_is_setting_enabled($value, $compare_with = null) {
1497
+	if ( ! is_null($compare_with)) {
1498 1498
 
1499
-		if ( is_array( $compare_with ) ) {
1499
+		if (is_array($compare_with)) {
1500 1500
 			// Output.
1501
-			return in_array( $value, $compare_with );
1501
+			return in_array($value, $compare_with);
1502 1502
 		}
1503 1503
 
1504 1504
 		// Output.
1505
-		return ( $value === $compare_with );
1505
+		return ($value === $compare_with);
1506 1506
 	}
1507 1507
 
1508 1508
 	// Backward compatibility: From version 1.8 most of setting is modified to enabled/disabled
1509 1509
 	// Output.
1510
-	return ( in_array( $value, array( 'enabled', 'on', 'yes' ) ) ? true : false );
1510
+	return (in_array($value, array('enabled', 'on', 'yes')) ? true : false);
1511 1511
 }
Please login to merge, or discard this patch.