Completed
Pull Request — master (#1683)
by
unknown
21:04
created
includes/admin/class-admin-settings.php 1 patch
Spacing   +205 added lines, -205 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;
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Admin_Settings' ) ) :
16
+if ( ! class_exists('Give_Admin_Settings')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Admin_Settings Class.
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			 *
73 73
 			 * @param array $settings Array of settings class object.
74 74
 			 */
75
-			self::$settings = apply_filters( self::$setting_filter_prefix . '_get_settings_pages', array() );
75
+			self::$settings = apply_filters(self::$setting_filter_prefix.'_get_settings_pages', array());
76 76
 
77 77
 			return self::$settings;
78 78
 		}
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 		public static function save() {
87 87
 			$current_tab = give_get_current_setting_tab();
88 88
 
89
-			if ( empty( $_REQUEST['_give-save-settings'] ) || ! wp_verify_nonce( $_REQUEST['_give-save-settings'], 'give-save-settings' ) ) {
90
-				echo '<div class="notice error"><p>' . __( 'Action failed. Please refresh the page and retry.', 'give' ) . '</p></div>';
89
+			if (empty($_REQUEST['_give-save-settings']) || ! wp_verify_nonce($_REQUEST['_give-save-settings'], 'give-save-settings')) {
90
+				echo '<div class="notice error"><p>'.__('Action failed. Please refresh the page and retry.', 'give').'</p></div>';
91 91
 				die();
92 92
 			}
93 93
 
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 			 *
101 101
 			 * @since 1.8
102 102
 			 */
103
-			do_action( self::$setting_filter_prefix . '_save_' . $current_tab );
103
+			do_action(self::$setting_filter_prefix.'_save_'.$current_tab);
104 104
 
105
-			self::add_message( 'give-setting-updated', __( 'Your settings have been saved.', 'give' ) );
105
+			self::add_message('give-setting-updated', __('Your settings have been saved.', 'give'));
106 106
 
107 107
 			/**
108 108
 			 * Trigger Action.
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			 *
114 114
 			 * @since 1.8
115 115
 			 */
116
-			do_action( self::$setting_filter_prefix . '_saved' );
116
+			do_action(self::$setting_filter_prefix.'_saved');
117 117
 		}
118 118
 
119 119
 		/**
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 		 *
127 127
 		 * @return void
128 128
 		 */
129
-		public static function add_message( $code, $message ) {
130
-			self::$messages[ $code ] = $message;
129
+		public static function add_message($code, $message) {
130
+			self::$messages[$code] = $message;
131 131
 		}
132 132
 
133 133
 		/**
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 		 *
141 141
 		 * @return void
142 142
 		 */
143
-		public static function add_error( $code, $message ) {
144
-			self::$errors[ $code ] = $message;
143
+		public static function add_error($code, $message) {
144
+			self::$errors[$code] = $message;
145 145
 		}
146 146
 
147 147
 		/**
@@ -154,18 +154,18 @@  discard block
 block discarded – undo
154 154
 			$notice_html = '';
155 155
 			$classes     = 'give-notice settings-error notice is-dismissible';
156 156
 
157
-			self::$errors   = apply_filters( self::$setting_filter_prefix . '_error_notices', self::$errors );
158
-			self::$messages = apply_filters( self::$setting_filter_prefix . '_update_notices', self::$messages );
157
+			self::$errors   = apply_filters(self::$setting_filter_prefix.'_error_notices', self::$errors);
158
+			self::$messages = apply_filters(self::$setting_filter_prefix.'_update_notices', self::$messages);
159 159
 
160
-			if ( 0 < count( self::$errors ) ) {
161
-				foreach ( self::$errors as $code => $message ) {
162
-					$notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' error"><p><strong>' . $message . '</strong></p></div>';
160
+			if (0 < count(self::$errors)) {
161
+				foreach (self::$errors as $code => $message) {
162
+					$notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' error"><p><strong>'.$message.'</strong></p></div>';
163 163
 				}
164 164
 			}
165 165
 
166
-			if ( 0 < count( self::$messages ) ) {
167
-				foreach ( self::$messages as $code => $message ) {
168
-					$notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' updated"><p><strong>' . $message . '</strong></p></div>';
166
+			if (0 < count(self::$messages)) {
167
+				foreach (self::$messages as $code => $message) {
168
+					$notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' updated"><p><strong>'.$message.'</strong></p></div>';
169 169
 				}
170 170
 			}
171 171
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 			self::$setting_filter_prefix = give_get_current_setting_page();
186 186
 
187 187
 			// Bailout: Exit if setting page is not defined.
188
-			if ( empty( self::$setting_filter_prefix ) ) {
188
+			if (empty(self::$setting_filter_prefix)) {
189 189
 				return false;
190 190
 			}
191 191
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			 *
199 199
 			 * @since 1.8
200 200
 			 */
201
-			do_action( self::$setting_filter_prefix . '_start' );
201
+			do_action(self::$setting_filter_prefix.'_start');
202 202
 
203 203
 			$current_tab = give_get_current_setting_tab();
204 204
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 			self::get_settings_pages();
207 207
 
208 208
 			// Save settings if data has been posted.
209
-			if ( ! empty( $_POST ) ) {
209
+			if ( ! empty($_POST)) {
210 210
 				self::save();
211 211
 			}
212 212
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 			 *
220 220
 			 * @since 1.8
221 221
 			 */
222
-			$tabs = apply_filters( self::$setting_filter_prefix . '_tabs_array', array() );
222
+			$tabs = apply_filters(self::$setting_filter_prefix.'_tabs_array', array());
223 223
 
224 224
 			include 'views/html-admin-settings.php';
225 225
 
@@ -237,25 +237,25 @@  discard block
 block discarded – undo
237 237
 		 *
238 238
 		 * @return string|bool
239 239
 		 */
240
-		public static function get_option( $option_name = '', $field_id = '', $default = false ) {
240
+		public static function get_option($option_name = '', $field_id = '', $default = false) {
241 241
 			// Bailout.
242
-			if ( empty( $option_name ) && empty( $field_id ) ) {
242
+			if (empty($option_name) && empty($field_id)) {
243 243
 				return false;
244 244
 			}
245 245
 
246
-			if ( ! empty( $field_id ) && ! empty( $option_name ) ) {
246
+			if ( ! empty($field_id) && ! empty($option_name)) {
247 247
 				// Get field value if any.
248
-				$option_value = get_option( $option_name );
248
+				$option_value = get_option($option_name);
249 249
 
250
-				$option_value = ( is_array( $option_value ) && array_key_exists( $field_id, $option_value ) )
251
-					? $option_value[ $field_id ]
250
+				$option_value = (is_array($option_value) && array_key_exists($field_id, $option_value))
251
+					? $option_value[$field_id]
252 252
 					: $default;
253 253
 			} else {
254 254
 				// If option name is empty but not field name then this means, setting is direct store to option table under there field name.
255 255
 				$option_name = ! $option_name ? $field_id : $option_name;
256 256
 
257 257
 				// Get option value if any.
258
-				$option_value = get_option( $option_name, $default );
258
+				$option_value = get_option($option_name, $default);
259 259
 			}
260 260
 
261 261
 			return $option_value;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		 *
274 274
 		 * @return void
275 275
 		 */
276
-		public static function output_fields( $options, $option_name = '' ) {
276
+		public static function output_fields($options, $option_name = '') {
277 277
 			$current_tab = give_get_current_setting_tab();
278 278
 
279 279
 			// Field Default values.
@@ -286,52 +286,52 @@  discard block
 block discarded – undo
286 286
 				'table_html' => true,
287 287
 			);
288 288
 
289
-			foreach ( $options as $value ) {
290
-				if ( ! isset( $value['type'] ) ) {
289
+			foreach ($options as $value) {
290
+				if ( ! isset($value['type'])) {
291 291
 					continue;
292 292
 				}
293 293
 
294 294
 				// Set title.
295
-				$defaults['title'] = isset( $value['name'] ) ? $value['name'] : '';
295
+				$defaults['title'] = isset($value['name']) ? $value['name'] : '';
296 296
 
297 297
 				// Set default setting.
298
-				$value = wp_parse_args( $value, $defaults );
298
+				$value = wp_parse_args($value, $defaults);
299 299
 
300 300
 				// Colorpicker field.
301
-				$value['class'] = ( 'colorpicker' === $value['type'] ? trim( $value['class'] ) . ' give-colorpicker' : $value['class'] );
302
-				$value['type']  = ( 'colorpicker' === $value['type'] ? 'text' : $value['type'] );
301
+				$value['class'] = ('colorpicker' === $value['type'] ? trim($value['class']).' give-colorpicker' : $value['class']);
302
+				$value['type']  = ('colorpicker' === $value['type'] ? 'text' : $value['type']);
303 303
 
304 304
 
305 305
 				// Custom attribute handling.
306 306
 				$custom_attributes = array();
307 307
 
308
-				if ( ! empty( $value['attributes'] ) && is_array( $value['attributes'] ) ) {
309
-					foreach ( $value['attributes'] as $attribute => $attribute_value ) {
310
-						$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
308
+				if ( ! empty($value['attributes']) && is_array($value['attributes'])) {
309
+					foreach ($value['attributes'] as $attribute => $attribute_value) {
310
+						$custom_attributes[] = esc_attr($attribute).'="'.esc_attr($attribute_value).'"';
311 311
 					}
312 312
 				}
313 313
 
314 314
 				// Description handling.
315
-				$description          = self::get_field_description( $value );
315
+				$description = self::get_field_description($value);
316 316
 
317 317
 				// Switch based on type.
318
-				switch ( $value['type'] ) {
318
+				switch ($value['type']) {
319 319
 
320 320
 					// Section Titles
321 321
 					case 'title':
322
-						if ( ! empty( $value['title'] ) ) {
323
-							echo '<div class="give-setting-tab-header give-setting-tab-header-' . $current_tab . '"><h2>' . self::get_field_title( $value ) . '</h2><hr></div>';
322
+						if ( ! empty($value['title'])) {
323
+							echo '<div class="give-setting-tab-header give-setting-tab-header-'.$current_tab.'"><h2>'.self::get_field_title($value).'</h2><hr></div>';
324 324
 						}
325 325
 
326
-						if ( ! empty( $value['desc'] ) ) {
327
-							echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) );
326
+						if ( ! empty($value['desc'])) {
327
+							echo wpautop(wptexturize(wp_kses_post($value['desc'])));
328 328
 						}
329 329
 
330
-						if ( $value['table_html'] ) {
331
-							echo '<table class="form-table give-setting-tab-body give-setting-tab-body-' . $current_tab . '">' . "\n\n";
330
+						if ($value['table_html']) {
331
+							echo '<table class="form-table give-setting-tab-body give-setting-tab-body-'.$current_tab.'">'."\n\n";
332 332
 						}
333 333
 
334
-						if ( ! empty( $value['id'] ) ) {
334
+						if ( ! empty($value['id'])) {
335 335
 
336 336
 							/**
337 337
 							 * Trigger Action.
@@ -340,14 +340,14 @@  discard block
 block discarded – undo
340 340
 							 *
341 341
 							 * @since 1.8
342 342
 							 */
343
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) );
343
+							do_action('give_settings_'.sanitize_title($value['id']));
344 344
 						}
345 345
 
346 346
 						break;
347 347
 
348 348
 					// Section Ends.
349 349
 					case 'sectionend':
350
-						if ( ! empty( $value['id'] ) ) {
350
+						if ( ! empty($value['id'])) {
351 351
 
352 352
 							/**
353 353
 							 * Trigger Action.
@@ -356,14 +356,14 @@  discard block
 block discarded – undo
356 356
 							 *
357 357
 							 * @since 1.8
358 358
 							 */
359
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_end' );
359
+							do_action('give_settings_'.sanitize_title($value['id']).'_end');
360 360
 						}
361 361
 
362
-						if ( $value['table_html'] ) {
362
+						if ($value['table_html']) {
363 363
 							echo '</table>';
364 364
 						}
365 365
 
366
-						if ( ! empty( $value['id'] ) ) {
366
+						if ( ! empty($value['id'])) {
367 367
 
368 368
 							/**
369 369
 							 * Trigger Action.
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 							 *
373 373
 							 * @since 1.8
374 374
 							 */
375
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_after' );
375
+							do_action('give_settings_'.sanitize_title($value['id']).'_after');
376 376
 						}
377 377
 
378 378
 						break;
@@ -385,22 +385,22 @@  discard block
 block discarded – undo
385 385
 					case 'password' :
386 386
 
387 387
 						$type = $value['type'];
388
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
388
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
389 389
 
390 390
 						?>
391
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
391
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
392 392
                         <th scope="row" class="titledesc">
393
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
393
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
394 394
                         </th>
395
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
395
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
396 396
                             <input
397
-                                    name="<?php echo esc_attr( $value['id'] ); ?>"
398
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
399
-                                    type="<?php echo esc_attr( $type ); ?>"
400
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
401
-                                    value="<?php echo esc_attr( $option_value ); ?>"
402
-                                    class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>"
403
-								<?php echo implode( ' ', $custom_attributes ); ?>
397
+                                    name="<?php echo esc_attr($value['id']); ?>"
398
+                                    id="<?php echo esc_attr($value['id']); ?>"
399
+                                    type="<?php echo esc_attr($type); ?>"
400
+                                    style="<?php echo esc_attr($value['css']); ?>"
401
+                                    value="<?php echo esc_attr($option_value); ?>"
402
+                                    class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>"
403
+								<?php echo implode(' ', $custom_attributes); ?>
404 404
                             /> <?php echo $description; ?>
405 405
                         </td>
406 406
                         </tr><?php
@@ -409,23 +409,23 @@  discard block
 block discarded – undo
409 409
 					// Textarea.
410 410
 					case 'textarea':
411 411
 
412
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
412
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
413 413
 
414 414
 						?>
415
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
415
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
416 416
                         <th scope="row" class="titledesc">
417
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
417
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
418 418
                         </th>
419
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
419
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
420 420
 								<textarea
421
-                                        name="<?php echo esc_attr( $value['id'] ); ?>"
422
-                                        id="<?php echo esc_attr( $value['id'] ); ?>"
423
-                                        style="<?php echo esc_attr( $value['css'] ); ?>"
424
-                                        class="<?php echo esc_attr( $value['class'] ); ?>"
421
+                                        name="<?php echo esc_attr($value['id']); ?>"
422
+                                        id="<?php echo esc_attr($value['id']); ?>"
423
+                                        style="<?php echo esc_attr($value['css']); ?>"
424
+                                        class="<?php echo esc_attr($value['class']); ?>"
425 425
                                         rows="10"
426 426
                                         cols="60"
427
-									<?php echo implode( ' ', $custom_attributes ); ?>
428
-                                ><?php echo esc_textarea( $option_value ); ?></textarea>
427
+									<?php echo implode(' ', $custom_attributes); ?>
428
+                                ><?php echo esc_textarea($option_value); ?></textarea>
429 429
 							<?php echo $description; ?>
430 430
                         </td>
431 431
                         </tr><?php
@@ -435,35 +435,35 @@  discard block
 block discarded – undo
435 435
 					case 'select' :
436 436
 					case 'multiselect' :
437 437
 
438
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
438
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
439 439
 
440 440
 						?>
441
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
441
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
442 442
                         <th scope="row" class="titledesc">
443
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
443
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
444 444
                         </th>
445
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
445
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
446 446
                             <select
447
-                                    name="<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) {
447
+                                    name="<?php echo esc_attr($value['id']); ?><?php if ($value['type'] == 'multiselect') {
448 448
 										echo '[]';
449 449
 									} ?>"
450
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
451
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
452
-                                    class="<?php echo esc_attr( $value['class'] ); ?>"
453
-								<?php echo implode( ' ', $custom_attributes ); ?>
454
-								<?php echo ( 'multiselect' == $value['type'] ) ? 'multiple="multiple"' : ''; ?>
450
+                                    id="<?php echo esc_attr($value['id']); ?>"
451
+                                    style="<?php echo esc_attr($value['css']); ?>"
452
+                                    class="<?php echo esc_attr($value['class']); ?>"
453
+								<?php echo implode(' ', $custom_attributes); ?>
454
+								<?php echo ('multiselect' == $value['type']) ? 'multiple="multiple"' : ''; ?>
455 455
                             >
456 456
 
457 457
 								<?php
458
-								if ( ! empty( $value['options'] ) ) {
459
-									foreach ( $value['options'] as $key => $val ) {
458
+								if ( ! empty($value['options'])) {
459
+									foreach ($value['options'] as $key => $val) {
460 460
 										?>
461
-                                        <option value="<?php echo esc_attr( $key ); ?>" <?php
461
+                                        <option value="<?php echo esc_attr($key); ?>" <?php
462 462
 
463
-										if ( is_array( $option_value ) ) {
464
-											selected( in_array( $key, $option_value ), true );
463
+										if (is_array($option_value)) {
464
+											selected(in_array($key, $option_value), true);
465 465
 										} else {
466
-											selected( $option_value, $key );
466
+											selected($option_value, $key);
467 467
 										}
468 468
 
469 469
 										?>><?php echo $val ?></option>
@@ -479,28 +479,28 @@  discard block
 block discarded – undo
479 479
 
480 480
 					// Radio inputs.
481 481
 					case 'radio_inline' :
482
-						$value['class'] = empty( $value['class'] ) ? 'give-radio-inline' : $value['class'] . ' give-radio-inline';
482
+						$value['class'] = empty($value['class']) ? 'give-radio-inline' : $value['class'].' give-radio-inline';
483 483
 					case 'radio' :
484
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
484
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
485 485
 						?>
486
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
486
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
487 487
                         <th scope="row" class="titledesc">
488
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
488
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
489 489
                         </th>
490
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>">
490
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>">
491 491
                             <fieldset>
492 492
                                 <ul>
493 493
 									<?php
494
-									foreach ( $value['options'] as $key => $val ) {
494
+									foreach ($value['options'] as $key => $val) {
495 495
 										?>
496 496
                                         <li>
497 497
                                             <label><input
498
-                                                        name="<?php echo esc_attr( $value['id'] ); ?>"
498
+                                                        name="<?php echo esc_attr($value['id']); ?>"
499 499
                                                         value="<?php echo $key; ?>"
500 500
                                                         type="radio"
501
-                                                        style="<?php echo esc_attr( $value['css'] ); ?>"
502
-													<?php echo implode( ' ', $custom_attributes ); ?>
503
-													<?php checked( $key, $option_value ); ?>
501
+                                                        style="<?php echo esc_attr($value['css']); ?>"
502
+													<?php echo implode(' ', $custom_attributes); ?>
503
+													<?php checked($key, $option_value); ?>
504 504
                                                 /> <?php echo $val ?></label>
505 505
                                         </li>
506 506
 										<?php
@@ -514,21 +514,21 @@  discard block
 block discarded – undo
514 514
 
515 515
 					// Checkbox input.
516 516
 					case 'checkbox' :
517
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
517
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
518 518
 						?>
519
-                        <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
519
+                        <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
520 520
                             <th scope="row" class="titledesc">
521
-                                <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
521
+                                <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
522 522
                             </th>
523 523
                             <td class="give-forminp">
524 524
                                 <input
525
-                                        name="<?php echo esc_attr( $value['id'] ); ?>"
526
-                                        id="<?php echo esc_attr( $value['id'] ); ?>"
525
+                                        name="<?php echo esc_attr($value['id']); ?>"
526
+                                        id="<?php echo esc_attr($value['id']); ?>"
527 527
                                         type="checkbox"
528
-                                        class="<?php echo esc_attr( isset( $value['class'] ) ? $value['class'] : '' ); ?>"
528
+                                        class="<?php echo esc_attr(isset($value['class']) ? $value['class'] : ''); ?>"
529 529
                                         value="1"
530
-									<?php checked( $option_value, 'on' ); ?>
531
-									<?php echo implode( ' ', $custom_attributes ); ?>
530
+									<?php checked($option_value, 'on'); ?>
531
+									<?php echo implode(' ', $custom_attributes); ?>
532 532
                                 />
533 533
 								<?php echo $description; ?>
534 534
                             </td>
@@ -538,28 +538,28 @@  discard block
 block discarded – undo
538 538
 
539 539
 					// Multi Checkbox input.
540 540
 					case 'multicheck' :
541
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
542
-						$option_value = is_array( $option_value ) ? $option_value : array();
541
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
542
+						$option_value = is_array($option_value) ? $option_value : array();
543 543
 						?>
544
-                        <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
544
+                        <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
545 545
                             <th scope="row" class="titledesc">
546
-                                <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
546
+                                <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
547 547
                             </th>
548
-                            <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>">
548
+                            <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>">
549 549
                                 <fieldset>
550 550
                                     <ul>
551 551
 										<?php
552
-										foreach ( $value['options'] as $key => $val ) {
552
+										foreach ($value['options'] as $key => $val) {
553 553
 											?>
554 554
                                             <li>
555 555
                                                 <label>
556 556
                                                     <input
557
-                                                            name="<?php echo esc_attr( $value['id'] ); ?>[]"
557
+                                                            name="<?php echo esc_attr($value['id']); ?>[]"
558 558
                                                             value="<?php echo $key; ?>"
559 559
                                                             type="checkbox"
560
-                                                            style="<?php echo esc_attr( $value['css'] ); ?>"
561
-														<?php echo implode( ' ', $custom_attributes ); ?>
562
-														<?php if ( in_array( $key, $option_value ) ) {
560
+                                                            style="<?php echo esc_attr($value['css']); ?>"
561
+														<?php echo implode(' ', $custom_attributes); ?>
562
+														<?php if (in_array($key, $option_value)) {
563 563
 															echo 'checked="checked"';
564 564
 														} ?>
565 565
                                                     /> <?php echo $val ?>
@@ -577,25 +577,25 @@  discard block
 block discarded – undo
577 577
 
578 578
 					// File input field.
579 579
 					case 'file' :
580
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
580
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
581 581
 						?>
582
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
582
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
583 583
                         <th scope="row" class="titledesc">
584
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
584
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
585 585
                         </th>
586 586
                         <td class="give-forminp">
587 587
                             <div class="give-field-wrap">
588 588
                                 <label for="<?php echo $value['id'] ?>">
589 589
                                     <input
590
-                                            name="<?php echo esc_attr( $value['id'] ); ?>"
591
-                                            id="<?php echo esc_attr( $value['id'] ); ?>"
590
+                                            name="<?php echo esc_attr($value['id']); ?>"
591
+                                            id="<?php echo esc_attr($value['id']); ?>"
592 592
                                             type="text"
593
-                                            class="give-input-field<?php echo esc_attr( isset( $value['class'] ) ? ' ' . $value['class'] : '' ); ?>"
593
+                                            class="give-input-field<?php echo esc_attr(isset($value['class']) ? ' '.$value['class'] : ''); ?>"
594 594
                                             value="<?php echo $option_value; ?>"
595
-                                            style="<?php echo esc_attr( $value['css'] ); ?>"
596
-										<?php echo implode( ' ', $custom_attributes ); ?>
595
+                                            style="<?php echo esc_attr($value['css']); ?>"
596
+										<?php echo implode(' ', $custom_attributes); ?>
597 597
                                     />&nbsp;&nbsp;&nbsp;&nbsp;<input class="give-upload-button button" type="button"
598
-                                                                     value="<?php echo esc_html__( 'Add or Upload File', 'give' ); ?>">
598
+                                                                     value="<?php echo esc_html__('Add or Upload File', 'give'); ?>">
599 599
 									<?php echo $description ?>
600 600
                                     <div class="give-image-thumb<?php echo ! $option_value ? ' give-hidden' : ''; ?>">
601 601
                                         <span class="give-delete-image-thumb dashicons dashicons-no-alt"></span>
@@ -610,17 +610,17 @@  discard block
 block discarded – undo
610 610
 					// WordPress Editor.
611 611
 					case 'wysiwyg' :
612 612
 						// Get option value.
613
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
613
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
614 614
 
615 615
 						// Get editor settings.
616
-						$editor_settings = ! empty( $value['options'] ) ? $value['options'] : array();
616
+						$editor_settings = ! empty($value['options']) ? $value['options'] : array();
617 617
 						?>
618
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
618
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
619 619
                         <th scope="row" class="titledesc">
620
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
620
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
621 621
                         </th>
622 622
                         <td class="give-forminp">
623
-							<?php wp_editor( $option_value, $value['id'], $editor_settings ); ?>
623
+							<?php wp_editor($option_value, $value['id'], $editor_settings); ?>
624 624
 							<?php echo $description; ?>
625 625
                         </td>
626 626
                         </tr><?php
@@ -629,9 +629,9 @@  discard block
 block discarded – undo
629 629
 					// Custom: System setting field.
630 630
 					case 'system_info' :
631 631
 						?>
632
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
632
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
633 633
                         <th scope="row" class="titledesc">
634
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
634
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
635 635
                         </th>
636 636
                         <td class="give-forminp">
637 637
 							<?php give_system_info_callback(); ?>
@@ -642,14 +642,14 @@  discard block
 block discarded – undo
642 642
 
643 643
 					// Custom: Default gateways setting field.
644 644
 					case 'default_gateway' :
645
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
645
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
646 646
 						?>
647
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
647
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
648 648
                         <th scope="row" class="titledesc">
649
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
649
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
650 650
                         </th>
651 651
                         <td class="give-forminp">
652
-							<?php give_default_gateway_callback( $value, $option_value ); ?>
652
+							<?php give_default_gateway_callback($value, $option_value); ?>
653 653
 							<?php echo $description; ?>
654 654
                         </td>
655 655
                         </tr><?php
@@ -657,14 +657,14 @@  discard block
 block discarded – undo
657 657
 
658 658
 					// Custom: Enable gateways setting field.
659 659
 					case 'enabled_gateways' :
660
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
660
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
661 661
 						?>
662
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
662
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
663 663
                         <th scope="row" class="titledesc">
664
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
664
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
665 665
                         </th>
666 666
                         <td class="give-forminp">
667
-							<?php give_enabled_gateways_callback( $value, $option_value ); ?>
667
+							<?php give_enabled_gateways_callback($value, $option_value); ?>
668 668
 							<?php echo $description; ?>
669 669
                         </td>
670 670
                         </tr><?php
@@ -673,9 +673,9 @@  discard block
 block discarded – undo
673 673
 					// Custom: Email preview buttons field.
674 674
 					case 'email_preview_buttons' :
675 675
 						?>
676
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
676
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
677 677
                         <th scope="row" class="titledesc">
678
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
678
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
679 679
                         </th>
680 680
                         <td class="give-forminp">
681 681
 							<?php give_email_preview_buttons_callback(); ?>
@@ -692,22 +692,22 @@  discard block
 block discarded – undo
692 692
 
693 693
 					// Custom: Gateway API key.
694 694
 					case 'api_key' :
695
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
696
-						$type         = ! empty( $option_value ) ? 'password' : 'text';
695
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
696
+						$type         = ! empty($option_value) ? 'password' : 'text';
697 697
 						?>
698
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
698
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
699 699
                         <th scope="row" class="titledesc">
700
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
700
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
701 701
                         </th>
702
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
702
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
703 703
                             <input
704
-                                    name="<?php echo esc_attr( $value['id'] ); ?>"
705
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
706
-                                    type="<?php echo esc_attr( $type ); ?>"
707
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
708
-                                    value="<?php echo esc_attr( trim( $option_value ) ); ?>"
709
-                                    class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>"
710
-								<?php echo implode( ' ', $custom_attributes ); ?>
704
+                                    name="<?php echo esc_attr($value['id']); ?>"
705
+                                    id="<?php echo esc_attr($value['id']); ?>"
706
+                                    type="<?php echo esc_attr($type); ?>"
707
+                                    style="<?php echo esc_attr($value['css']); ?>"
708
+                                    value="<?php echo esc_attr(trim($option_value)); ?>"
709
+                                    class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>"
710
+								<?php echo implode(' ', $custom_attributes); ?>
711 711
                             /> <?php echo $description; ?>
712 712
                         </td>
713 713
                         </tr><?php
@@ -729,12 +729,12 @@  discard block
 block discarded – undo
729 729
 					// Custom: Give Docs Link field type.
730 730
 					case 'give_docs_link' :
731 731
 						?>
732
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
732
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
733 733
                         <td class="give-docs-link" colspan="2">
734 734
 							<?php
735
-							echo '<p class="give-docs-link"><a href="' . esc_url( $value['url'] )
735
+							echo '<p class="give-docs-link"><a href="'.esc_url($value['url'])
736 736
 							     . '" target="_blank">'
737
-							     . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $value['title'] )
737
+							     . sprintf(esc_html__('Need Help? See docs on "%s"', 'give'), $value['title'])
738 738
 							     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
739 739
 							?>
740 740
                         </td>
@@ -745,8 +745,8 @@  discard block
 block discarded – undo
745 745
 					// You can add or handle your custom field action.
746 746
 					default:
747 747
 						// Get option value.
748
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
749
-						do_action( 'give_admin_field_' . $value['type'], $value, $option_value );
748
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
749
+						do_action('give_admin_field_'.$value['type'], $value, $option_value);
750 750
 						break;
751 751
 				}
752 752
 			}
@@ -762,15 +762,15 @@  discard block
 block discarded – undo
762 762
 		 *
763 763
 		 * @return string The HTML description of the field.
764 764
 		 */
765
-		public static function get_field_description( $value ) {
765
+		public static function get_field_description($value) {
766 766
 			$description = '';
767 767
 
768 768
 			// Support for both 'description' and 'desc' args.
769
-			$description_key = isset( $value['description'] ) ? 'description' : 'desc';
770
-			$value           = ( isset( $value[ $description_key ] ) && ! empty( $value[ $description_key ] ) ) ? $value[ $description_key ] : '';
769
+			$description_key = isset($value['description']) ? 'description' : 'desc';
770
+			$value           = (isset($value[$description_key]) && ! empty($value[$description_key])) ? $value[$description_key] : '';
771 771
 
772
-			if ( ! empty( $value ) ) {
773
-				$description = '<p class="give-field-description">' . wp_kses_post( $value ) . '</p>';
772
+			if ( ! empty($value)) {
773
+				$description = '<p class="give-field-description">'.wp_kses_post($value).'</p>';
774 774
 			}
775 775
 
776 776
 			return $description;
@@ -787,11 +787,11 @@  discard block
 block discarded – undo
787 787
 		 *
788 788
 		 * @return array The description and tip as a 2 element array
789 789
 		 */
790
-		public static function get_field_title( $value ) {
791
-			$title = esc_html( $value['title'] );
790
+		public static function get_field_title($value) {
791
+			$title = esc_html($value['title']);
792 792
 
793 793
 			// If html tag detected then allow them to print.
794
-			if ( strip_tags( $title ) ) {
794
+			if (strip_tags($title)) {
795 795
 				$title = $value['title'];
796 796
 			}
797 797
 
@@ -810,8 +810,8 @@  discard block
 block discarded – undo
810 810
 		 *
811 811
 		 * @return bool
812 812
 		 */
813
-		public static function save_fields( $options, $option_name = '' ) {
814
-			if ( empty( $_POST ) ) {
813
+		public static function save_fields($options, $option_name = '') {
814
+			if (empty($_POST)) {
815 815
 				return false;
816 816
 			}
817 817
 
@@ -819,37 +819,37 @@  discard block
 block discarded – undo
819 819
 			$update_options = array();
820 820
 
821 821
 			// Loop options and get values to save.
822
-			foreach ( $options as $option ) {
823
-				if ( ! isset( $option['id'] ) || ! isset( $option['type'] ) ) {
822
+			foreach ($options as $option) {
823
+				if ( ! isset($option['id']) || ! isset($option['type'])) {
824 824
 					continue;
825 825
 				}
826 826
 
827 827
 				// Get posted value.
828
-				if ( strstr( $option['id'], '[' ) ) {
829
-					parse_str( $option['id'], $option_name_array );
830
-					$field_option_name = current( array_keys( $option_name_array ) );
831
-					$setting_name      = key( $option_name_array[ $field_option_name ] );
832
-					$raw_value         = isset( $_POST[ $field_option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $field_option_name ][ $setting_name ] ) : null;
828
+				if (strstr($option['id'], '[')) {
829
+					parse_str($option['id'], $option_name_array);
830
+					$field_option_name = current(array_keys($option_name_array));
831
+					$setting_name      = key($option_name_array[$field_option_name]);
832
+					$raw_value         = isset($_POST[$field_option_name][$setting_name]) ? wp_unslash($_POST[$field_option_name][$setting_name]) : null;
833 833
 				} else {
834 834
 					$field_option_name = $option['id'];
835 835
 					$setting_name      = '';
836
-					$raw_value         = isset( $_POST[ $option['id'] ] ) ? wp_unslash( $_POST[ $option['id'] ] ) : null;
836
+					$raw_value         = isset($_POST[$option['id']]) ? wp_unslash($_POST[$option['id']]) : null;
837 837
 				}
838 838
 
839 839
 				// Format the value based on option type.
840
-				switch ( $option['type'] ) {
840
+				switch ($option['type']) {
841 841
 					case 'checkbox' :
842
-						$value = is_null( $raw_value ) ? '' : 'on';
842
+						$value = is_null($raw_value) ? '' : 'on';
843 843
 						break;
844 844
 					case 'wysiwyg'  :
845 845
 					case 'textarea' :
846
-						$value = wp_kses_post( trim( $raw_value ) );
846
+						$value = wp_kses_post(trim($raw_value));
847 847
 						break;
848 848
 					case 'multiselect' :
849
-						$value = array_filter( array_map( 'give_clean', (array) $raw_value ) );
849
+						$value = array_filter(array_map('give_clean', (array) $raw_value));
850 850
 						break;
851 851
 					default :
852
-						$value = give_clean( $raw_value );
852
+						$value = give_clean($raw_value);
853 853
 						break;
854 854
 				}
855 855
 
@@ -858,37 +858,37 @@  discard block
 block discarded – undo
858 858
 				 *
859 859
 				 * @since 1.8
860 860
 				 */
861
-				$value = apply_filters( 'give_admin_settings_sanitize_option', $value, $option, $raw_value );
861
+				$value = apply_filters('give_admin_settings_sanitize_option', $value, $option, $raw_value);
862 862
 
863 863
 				/**
864 864
 				 * Sanitize the value of an option by option name.
865 865
 				 *
866 866
 				 * @since 1.8
867 867
 				 */
868
-				$value = apply_filters( "give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value );
868
+				$value = apply_filters("give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value);
869 869
 
870
-				if ( is_null( $value ) ) {
870
+				if (is_null($value)) {
871 871
 					continue;
872 872
 				}
873 873
 
874 874
 				// Check if option is an array and handle that differently to single values.
875
-				if ( $field_option_name && $setting_name ) {
876
-					if ( ! isset( $update_options[ $field_option_name ] ) ) {
877
-						$update_options[ $field_option_name ] = get_option( $field_option_name, array() );
875
+				if ($field_option_name && $setting_name) {
876
+					if ( ! isset($update_options[$field_option_name])) {
877
+						$update_options[$field_option_name] = get_option($field_option_name, array());
878 878
 					}
879
-					if ( ! is_array( $update_options[ $field_option_name ] ) ) {
880
-						$update_options[ $field_option_name ] = array();
879
+					if ( ! is_array($update_options[$field_option_name])) {
880
+						$update_options[$field_option_name] = array();
881 881
 					}
882
-					$update_options[ $field_option_name ][ $setting_name ] = $value;
882
+					$update_options[$field_option_name][$setting_name] = $value;
883 883
 				} else {
884
-					$update_options[ $field_option_name ] = $value;
884
+					$update_options[$field_option_name] = $value;
885 885
 				}
886 886
 			}
887 887
 
888 888
 			// Save all options in our array or there own option name i.e. option id.
889
-			if ( empty( $option_name ) ) {
890
-				foreach ( $update_options as $name => $value ) {
891
-					update_option( $name, $value );
889
+			if (empty($option_name)) {
890
+				foreach ($update_options as $name => $value) {
891
+					update_option($name, $value);
892 892
 
893 893
 					/**
894 894
 					 * Trigger action.
@@ -897,13 +897,13 @@  discard block
 block discarded – undo
897 897
 					 *
898 898
 					 * @since 1.8
899 899
 					 */
900
-					do_action( "give_save_option_{$name}", $value, $name );
900
+					do_action("give_save_option_{$name}", $value, $name);
901 901
 				}
902 902
 			} else {
903
-				$old_options    = ( $old_options = get_option( $option_name ) ) ? $old_options : array();
904
-				$update_options = array_merge( $old_options, $update_options );
903
+				$old_options    = ($old_options = get_option($option_name)) ? $old_options : array();
904
+				$update_options = array_merge($old_options, $update_options);
905 905
 
906
-				update_option( $option_name, $update_options );
906
+				update_option($option_name, $update_options);
907 907
 
908 908
 				/**
909 909
 				 * Trigger action.
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 				 *
913 913
 				 * @since 1.8
914 914
 				 */
915
-				do_action( "give_save_settings_{$option_name}", $update_options, $option_name );
915
+				do_action("give_save_settings_{$option_name}", $update_options, $option_name);
916 916
 			}
917 917
 
918 918
 			return true;
Please login to merge, or discard this patch.