Completed
Pull Request — master (#448)
by Stephanie
58s
created
classes/models/FrmHoneypot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 	private function check_honeypot_setting() {
49 49
 		$form = $this->get_form();
50 50
 		$key  = $this->get_option_key();
51
-		return $form->options[ $key ];
51
+		return $form->options[$key];
52 52
 	}
53 53
 
54 54
 	/**
Please login to merge, or discard this patch.
classes/models/FrmValidate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 	protected function is_option_on() {
39 39
 		$form = $this->get_form();
40 40
 		$key  = $this->get_option_key();
41
-		return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ];
41
+		return ! empty( $form->options[$key] ) && 'off' !== $form->options[$key];
42 42
 	}
43 43
 
44 44
 	/**
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldName.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -46,19 +46,19 @@  discard block
 block discarded – undo
46 46
 		$result = array();
47 47
 
48 48
 		foreach ( $names as $name ) {
49
-			if ( empty( $this->sub_fields[ $name ] ) ) {
49
+			if ( empty( $this->sub_fields[$name] ) ) {
50 50
 				continue;
51 51
 			}
52 52
 
53
-			if ( ! isset( $this->sub_fields[ $name ]['wrapper_classes'] ) ) {
54
-				$this->sub_fields[ $name ]['wrapper_classes'] = $col_class;
55
-			} elseif ( is_array( $this->sub_fields[ $name ]['wrapper_classes'] ) ) {
56
-				$this->sub_fields[ $name ]['wrapper_classes'] = implode( ' ', $this->sub_fields[ $name ]['wrapper_classes'] ) . ' ' . $col_class;
53
+			if ( ! isset( $this->sub_fields[$name]['wrapper_classes'] ) ) {
54
+				$this->sub_fields[$name]['wrapper_classes'] = $col_class;
55
+			} elseif ( is_array( $this->sub_fields[$name]['wrapper_classes'] ) ) {
56
+				$this->sub_fields[$name]['wrapper_classes'] = implode( ' ', $this->sub_fields[$name]['wrapper_classes'] ) . ' ' . $col_class;
57 57
 			} else {
58
-				$this->sub_fields[ $name ]['wrapper_classes'] .= ' ' . $col_class;
58
+				$this->sub_fields[$name]['wrapper_classes'] .= ' ' . $col_class;
59 59
 			}
60 60
 
61
-			$result[ $name ] = $this->sub_fields[ $name ];
61
+			$result[$name] = $this->sub_fields[$name];
62 62
 		}
63 63
 
64 64
 		return $result;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 		// Default desc.
91 91
 		foreach ( $this->sub_fields as $name => $sub_field ) {
92
-			$extra_options[ $name . '_desc' ] = $sub_field['label'];
92
+			$extra_options[$name . '_desc'] = $sub_field['label'];
93 93
 		}
94 94
 
95 95
 		return $extra_options;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		$name_layout = $this->get_name_layout();
126 126
 
127 127
 		if ( ! empty( $atts['show'] ) ) {
128
-			return isset( $value[ $atts['show'] ] ) ? $value[ $atts['show'] ] : '';
128
+			return isset( $value[$atts['show']] ) ? $value[$atts['show']] : '';
129 129
 		}
130 130
 
131 131
 		$value = wp_parse_args(
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			$args['sub_fields'] = $this->sub_fields;
199 199
 
200 200
 			foreach ( $hidden_fields as $name => $hidden_field ) {
201
-				$args['sub_fields'][ $name ]['wrapper_classes'] .= ' frm_hidden';
201
+				$args['sub_fields'][$name]['wrapper_classes'] .= ' frm_hidden';
202 202
 			}
203 203
 		}
204 204
 	}
Please login to merge, or discard this patch.
classes/models/FrmEntry.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			$metas       = FrmEntryMeta::get_entry_meta_info( $entry_exist );
78 78
 			$field_metas = array();
79 79
 			foreach ( $metas as $meta ) {
80
-				$field_metas[ $meta->field_id ] = $meta->meta_value;
80
+				$field_metas[$meta->field_id] = $meta->meta_value;
81 81
 			}
82 82
 
83 83
 			$filtered_vals = array_filter( $values['item_meta'] );
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
 		$reduced = array();
132 132
 		foreach ( $filter_vals as $field_id => $value ) {
133 133
 			$field                = FrmFieldFactory::get_field_object( $field_id );
134
-			$reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
135
-			$reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] );
136
-			if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) {
137
-				unset( $reduced[ $field_id ] );
134
+			$reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
135
+			$reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] );
136
+			if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) {
137
+				unset( $reduced[$field_id] );
138 138
 			}
139 139
 		}
140 140
 		return $reduced;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		$query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it
328 328
                   LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE ";
329 329
 
330
-		$query      .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
330
+		$query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
331 331
 		$query_args = array( $id );
332 332
 		$query      = $wpdb->prepare( $query, $query_args ); // WPCS: unprepared SQL ok.
333 333
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	private static function prepare_entries( &$entries ) {
373 373
 		foreach ( $entries as $k => $entry ) {
374 374
 			self::prepare_entry( $entry );
375
-			$entries[ $k ] = $entry;
375
+			$entries[$k] = $entry;
376 376
 		}
377 377
 	}
378 378
 
@@ -397,20 +397,20 @@  discard block
 block discarded – undo
397 397
 		foreach ( $metas as $meta_val ) {
398 398
 			if ( $meta_val->item_id == $entry->id ) {
399 399
 				FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
400
-				$entry->metas[ $meta_val->field_id ] = $meta_val->meta_value;
400
+				$entry->metas[$meta_val->field_id] = $meta_val->meta_value;
401 401
 				if ( $include_key ) {
402
-					$entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ];
402
+					$entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id];
403 403
 				}
404 404
 				continue;
405 405
 			}
406 406
 
407 407
 			// include sub entries in an array
408
-			if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) {
409
-				$entry->metas[ $meta_val->field_id ] = array();
408
+			if ( ! isset( $entry->metas[$meta_val->field_id] ) ) {
409
+				$entry->metas[$meta_val->field_id] = array();
410 410
 			}
411 411
 
412 412
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
413
-			$entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value;
413
+			$entry->metas[$meta_val->field_id][] = $meta_val->meta_value;
414 414
 
415 415
 			unset( $meta_val );
416 416
 		}
@@ -457,13 +457,13 @@  discard block
 block discarded – undo
457 457
 
458 458
 			if ( $inc_form ) {
459 459
 				$fields = 'it.*, fr.name as form_name,fr.form_key as form_key';
460
-				$table  .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
460
+				$table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
461 461
 			}
462 462
 
463 463
 			if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) {
464 464
 				// sort by a requested field
465 465
 				$field_id = (int) $order_matches[1];
466
-				$fields   .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id;
466
+				$fields .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id;
467 467
 				unset( $order_matches, $field_id );
468 468
 			}
469 469
 
@@ -503,16 +503,16 @@  discard block
 block discarded – undo
503 503
 		}
504 504
 
505 505
 		foreach ( $metas as $m_key => $meta_val ) {
506
-			if ( ! isset( $entries[ $meta_val->item_id ] ) ) {
506
+			if ( ! isset( $entries[$meta_val->item_id] ) ) {
507 507
 				continue;
508 508
 			}
509 509
 
510
-			if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) {
511
-				$entries[ $meta_val->item_id ]->metas = array();
510
+			if ( ! isset( $entries[$meta_val->item_id]->metas ) ) {
511
+				$entries[$meta_val->item_id]->metas = array();
512 512
 			}
513 513
 
514 514
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
515
-			$entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value;
515
+			$entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value;
516 516
 			unset( $m_key, $meta_val );
517 517
 		}
518 518
 
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 	}
671 671
 
672 672
 	private static function get_entry_value( $values, $name, $default ) {
673
-		return isset( $values[ $name ] ) ? $values[ $name ] : $default;
673
+		return isset( $values[$name] ) ? $values[$name] : $default;
674 674
 	}
675 675
 
676 676
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 			'fill'   => '#4d4d4d',
158 158
 			'orange' => '#f05a24',
159 159
 		);
160
-		$atts     = array_merge( $defaults, $atts );
160
+		$atts = array_merge( $defaults, $atts );
161 161
 
162 162
 		return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '">
163 163
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	 * @return string
365 365
 	 */
366 366
 	public static function get_server_value( $value ) {
367
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
367
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
368 368
 	}
369 369
 
370 370
 	/**
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		);
388 388
 		$ip = '';
389 389
 		foreach ( $ip_options as $key ) {
390
-			if ( ! isset( $_SERVER[ $key ] ) ) {
390
+			if ( ! isset( $_SERVER[$key] ) ) {
391 391
 				continue;
392 392
 			}
393 393
 
@@ -412,10 +412,10 @@  discard block
 block discarded – undo
412 412
 
413 413
 		if ( $src == 'get' ) {
414 414
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
415
-			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default );
416
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
415
+			$value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default );
416
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) {
417 417
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
418
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
418
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
419 419
 			}
420 420
 			self::sanitize_value( $sanitize, $value );
421 421
 		} else {
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 				}
437 437
 
438 438
 				$p     = trim( $p, ']' );
439
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
439
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
440 440
 			}
441 441
 		}
442 442
 
@@ -492,26 +492,26 @@  discard block
 block discarded – undo
492 492
 			'sanitize' => 'sanitize_text_field',
493 493
 			'serialized' => false,
494 494
 		);
495
-		$args     = wp_parse_args( $args, $defaults );
495
+		$args = wp_parse_args( $args, $defaults );
496 496
 
497 497
 		$value = $args['default'];
498 498
 		if ( $args['type'] == 'get' ) {
499
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
499
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
500 500
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
501
-				$value = wp_unslash( $_GET[ $args['param'] ] );
501
+				$value = wp_unslash( $_GET[$args['param']] );
502 502
 			}
503 503
 		} elseif ( $args['type'] == 'post' ) {
504
-			if ( isset( $_POST[ $args['param'] ] ) ) {
504
+			if ( isset( $_POST[$args['param']] ) ) {
505 505
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
506
-				$value = wp_unslash( $_POST[ $args['param'] ] );
506
+				$value = wp_unslash( $_POST[$args['param']] );
507 507
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
508 508
 					self::unserialize_or_decode( $value );
509 509
 				}
510 510
 			}
511 511
 		} else {
512
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) {
512
+			if ( isset( $_REQUEST[$args['param']] ) ) {
513 513
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
514
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
514
+				$value = wp_unslash( $_REQUEST[$args['param']] );
515 515
 			}
516 516
 		}
517 517
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 			if ( is_array( $value ) ) {
544 544
 				$temp_values = $value;
545 545
 				foreach ( $temp_values as $k => $v ) {
546
-					self::sanitize_value( $sanitize, $value[ $k ] );
546
+					self::sanitize_value( $sanitize, $value[$k] );
547 547
 				}
548 548
 			} else {
549 549
 				$value = call_user_func( $sanitize, $value );
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
 	public static function sanitize_request( $sanitize_method, &$values ) {
555 555
 		$temp_values = $values;
556 556
 		foreach ( $temp_values as $k => $val ) {
557
-			if ( isset( $sanitize_method[ $k ] ) ) {
558
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
557
+			if ( isset( $sanitize_method[$k] ) ) {
558
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
559 559
 			}
560 560
 		}
561 561
 	}
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 		if ( is_array( $value ) ) {
579 579
 			$temp_values = $value;
580 580
 			foreach ( $temp_values as $k => $v ) {
581
-				self::decode_specialchars( $value[ $k ] );
581
+				self::decode_specialchars( $value[$k] );
582 582
 			}
583 583
 		} else {
584 584
 			self::decode_amp( $value );
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 			$allowed_html = $html;
656 656
 		} elseif ( ! empty( $allowed ) ) {
657 657
 			foreach ( (array) $allowed as $a ) {
658
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
658
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
659 659
 			}
660 660
 		}
661 661
 
@@ -817,8 +817,8 @@  discard block
 block discarded – undo
817 817
 		}
818 818
 
819 819
 		global $wp_query;
820
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
821
-			$value = $wp_query->query_vars[ $param ];
820
+		if ( isset( $wp_query->query_vars[$param] ) ) {
821
+			$value = $wp_query->query_vars[$param];
822 822
 		}
823 823
 
824 824
 		return $value;
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 				'new_file_path' => self::plugin_path() . '/js',
997 997
 			)
998 998
 		);
999
-		$new_file  = new FrmCreateFile( $file_atts );
999
+		$new_file = new FrmCreateFile( $file_atts );
1000 1000
 
1001 1001
 		$files = array(
1002 1002
 			self::plugin_path() . '/js/jquery/jquery.placeholder.min.js',
@@ -1388,8 +1388,8 @@  discard block
 block discarded – undo
1388 1388
 			return $error;
1389 1389
 		}
1390 1390
 
1391
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1392
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1391
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1392
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1393 1393
 			$frm_settings = self::get_settings();
1394 1394
 			$error        = $frm_settings->admin_permission;
1395 1395
 		}
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
 			} else {
1425 1425
 				foreach ( $value as $k => $v ) {
1426 1426
 					if ( ! is_array( $v ) ) {
1427
-						$value[ $k ] = call_user_func( $original_function, $v );
1427
+						$value[$k] = call_user_func( $original_function, $v );
1428 1428
 					}
1429 1429
 				}
1430 1430
 			}
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
1450 1450
 			} else {
1451 1451
 				if ( $keys == 'keep' ) {
1452
-					$return[ $key ] = $value;
1452
+					$return[$key] = $value;
1453 1453
 				} else {
1454 1454
 					$return[] = $value;
1455 1455
 				}
@@ -1513,11 +1513,11 @@  discard block
 block discarded – undo
1513 1513
 		}
1514 1514
 
1515 1515
 		$ver = $default;
1516
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
1516
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
1517 1517
 			return $ver;
1518 1518
 		}
1519 1519
 
1520
-		$query = $wp_scripts->registered[ $handle ];
1520
+		$query = $wp_scripts->registered[$handle];
1521 1521
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
1522 1522
 			$ver = $query->ver;
1523 1523
 		}
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
 
1676 1676
 		foreach ( array( 'name', 'description' ) as $var ) {
1677 1677
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
1678
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1678
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1679 1679
 			unset( $var, $default_val );
1680 1680
 		}
1681 1681
 
@@ -1733,9 +1733,9 @@  discard block
 block discarded – undo
1733 1733
 			}
1734 1734
 		}
1735 1735
 
1736
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
1737
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
1738
-			$new_value = $post_values['item_meta'][ $field->id ];
1736
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
1737
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
1738
+			$new_value = $post_values['item_meta'][$field->id];
1739 1739
 			self::unserialize_or_decode( $new_value );
1740 1740
 		} else {
1741 1741
 			$new_value = $meta_value;
@@ -1756,7 +1756,7 @@  discard block
 block discarded – undo
1756 1756
 
1757 1757
 		$field_array = array_merge( (array) $field->field_options, $field_array );
1758 1758
 
1759
-		$values['fields'][ $field->id ] = $field_array;
1759
+		$values['fields'][$field->id] = $field_array;
1760 1760
 	}
1761 1761
 
1762 1762
 	/**
@@ -1803,11 +1803,11 @@  discard block
 block discarded – undo
1803 1803
 		}
1804 1804
 
1805 1805
 		foreach ( $form->options as $opt => $value ) {
1806
-			if ( isset( $post_values[ $opt ] ) ) {
1807
-				$values[ $opt ] = $post_values[ $opt ];
1808
-				self::unserialize_or_decode( $values[ $opt ] );
1806
+			if ( isset( $post_values[$opt] ) ) {
1807
+				$values[$opt] = $post_values[$opt];
1808
+				self::unserialize_or_decode( $values[$opt] );
1809 1809
 			} else {
1810
-				$values[ $opt ] = $value;
1810
+				$values[$opt] = $value;
1811 1811
 			}
1812 1812
 		}
1813 1813
 
@@ -1821,8 +1821,8 @@  discard block
 block discarded – undo
1821 1821
 		$form_defaults = FrmFormsHelper::get_default_opts();
1822 1822
 
1823 1823
 		foreach ( $form_defaults as $opt => $default ) {
1824
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
1825
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
1824
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
1825
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
1826 1826
 			}
1827 1827
 
1828 1828
 			unset( $opt, $default );
@@ -1833,8 +1833,8 @@  discard block
 block discarded – undo
1833 1833
 		}
1834 1834
 
1835 1835
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
1836
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
1837
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
1836
+			if ( ! isset( $values[$h . '_html'] ) ) {
1837
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
1838 1838
 			}
1839 1839
 			unset( $h );
1840 1840
 		}
@@ -1986,25 +1986,25 @@  discard block
 block discarded – undo
1986 1986
 		if ( ! is_numeric( $levels ) ) {
1987 1987
 			// Show time in specified unit.
1988 1988
 			$levels = self::get_unit( $levels );
1989
-			if ( isset( $time_strings[ $levels ] ) ) {
1989
+			if ( isset( $time_strings[$levels] ) ) {
1990 1990
 				$diff = array(
1991 1991
 					$levels => self::time_format( $levels, $diff ),
1992 1992
 				);
1993 1993
 				$time_strings = array(
1994
-					$levels => $time_strings[ $levels ],
1994
+					$levels => $time_strings[$levels],
1995 1995
 				);
1996 1996
 			}
1997 1997
 			$levels = 1;
1998 1998
 		}
1999 1999
 
2000 2000
 		foreach ( $time_strings as $k => $v ) {
2001
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2002
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2003
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2001
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2002
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2003
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2004 2004
 				// Account for 0.
2005
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2005
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2006 2006
 			} else {
2007
-				unset( $time_strings[ $k ] );
2007
+				unset( $time_strings[$k] );
2008 2008
 			}
2009 2009
 		}
2010 2010
 
@@ -2023,8 +2023,8 @@  discard block
 block discarded – undo
2023 2023
 			'y' => 'y',
2024 2024
 			'd' => 'days',
2025 2025
 		);
2026
-		if ( isset( $return[ $unit ] ) ) {
2027
-			return $diff[ $return[ $unit ] ];
2026
+		if ( isset( $return[$unit] ) ) {
2027
+			return $diff[$return[$unit]];
2028 2028
 		}
2029 2029
 
2030 2030
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2032,11 +2032,11 @@  discard block
 block discarded – undo
2032 2032
 		$times = array( 'h', 'i', 's' );
2033 2033
 
2034 2034
 		foreach ( $times as $time ) {
2035
-			if ( ! isset( $diff[ $time ] ) ) {
2035
+			if ( ! isset( $diff[$time] ) ) {
2036 2036
 				continue;
2037 2037
 			}
2038 2038
 
2039
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2039
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2040 2040
 		}
2041 2041
 
2042 2042
 		return floor( $total );
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 			'y' => DAY_IN_SECONDS * 365.25,
2057 2057
 		);
2058 2058
 
2059
-		return $convert[ $from ] / $convert[ $to ];
2059
+		return $convert[$from] / $convert[$to];
2060 2060
 	}
2061 2061
 
2062 2062
 	/**
@@ -2064,7 +2064,7 @@  discard block
 block discarded – undo
2064 2064
 	 */
2065 2065
 	private static function get_unit( $unit ) {
2066 2066
 		$units = self::get_time_strings();
2067
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2067
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2068 2068
 			return $unit;
2069 2069
 		}
2070 2070
 
@@ -2175,17 +2175,17 @@  discard block
 block discarded – undo
2175 2175
 
2176 2176
 					case 1:
2177 2177
 						$l2 = $name;
2178
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2178
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2179 2179
 						break;
2180 2180
 
2181 2181
 					case 2:
2182 2182
 						$l3 = $name;
2183
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2183
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2184 2184
 						break;
2185 2185
 
2186 2186
 					case 3:
2187 2187
 						$l4 = $name;
2188
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2188
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2189 2189
 				}
2190 2190
 
2191 2191
 				unset( $this_val, $n );
@@ -2204,8 +2204,8 @@  discard block
 block discarded – undo
2204 2204
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2205 2205
 		if ( $name == '' ) {
2206 2206
 			$vars[] = $val;
2207
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2208
-			$vars[ $l1 ] = $val;
2207
+		} elseif ( ! isset( $vars[$l1] ) ) {
2208
+			$vars[$l1] = $val;
2209 2209
 		}
2210 2210
 	}
2211 2211
 
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 			'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ),
2222 2222
 		);
2223 2223
 
2224
-		if ( ! isset( $tooltips[ $name ] ) ) {
2224
+		if ( ! isset( $tooltips[$name] ) ) {
2225 2225
 			return;
2226 2226
 		}
2227 2227
 
@@ -2231,7 +2231,7 @@  discard block
 block discarded – undo
2231 2231
 			echo ' class="frm_help"';
2232 2232
 		}
2233 2233
 
2234
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2234
+		echo ' title="' . esc_attr( $tooltips[$name] );
2235 2235
 
2236 2236
 		if ( 'open' != $class ) {
2237 2237
 			echo '"';
@@ -2286,13 +2286,13 @@  discard block
 block discarded – undo
2286 2286
 	}
2287 2287
 
2288 2288
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2289
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2289
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2290 2290
 			return;
2291 2291
 		}
2292 2292
 
2293 2293
 		if ( is_array( $val ) ) {
2294 2294
 			foreach ( $val as $k1 => $v1 ) {
2295
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2295
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2296 2296
 				unset( $k1, $v1 );
2297 2297
 			}
2298 2298
 		} else {
@@ -2300,7 +2300,7 @@  discard block
 block discarded – undo
2300 2300
 			$val = stripslashes( $val );
2301 2301
 
2302 2302
 			// Add backslashes before double quotes and forward slashes only
2303
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2303
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2304 2304
 		}
2305 2305
 	}
2306 2306
 
@@ -2359,14 +2359,14 @@  discard block
 block discarded – undo
2359 2359
 				continue;
2360 2360
 			}
2361 2361
 			$key = $input['name'];
2362
-			if ( isset( $formatted[ $key ] ) ) {
2363
-				if ( is_array( $formatted[ $key ] ) ) {
2364
-					$formatted[ $key ][] = $input['value'];
2362
+			if ( isset( $formatted[$key] ) ) {
2363
+				if ( is_array( $formatted[$key] ) ) {
2364
+					$formatted[$key][] = $input['value'];
2365 2365
 				} else {
2366
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
2366
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
2367 2367
 				}
2368 2368
 			} else {
2369
-				$formatted[ $key ] = $input['value'];
2369
+				$formatted[$key] = $input['value'];
2370 2370
 			}
2371 2371
 		}
2372 2372
 
Please login to merge, or discard this patch.
classes/models/FrmPluginSearch.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,16 +75,16 @@  discard block
 block discarded – undo
75 75
 			'name'                => sprintf(
76 76
 				/* translators: Formidable addon name */
77 77
 				esc_html_x( 'Formidable %s', 'Formidable Addon Name', 'formidable' ),
78
-				$addon_list[ $matching_addon ]['name']
78
+				$addon_list[$matching_addon]['name']
79 79
 			),
80
-			'addon'               => $addon_list[ $matching_addon ]['slug'],
81
-			'short_description'   => $addon_list[ $matching_addon ]['excerpt'],
80
+			'addon'               => $addon_list[$matching_addon]['slug'],
81
+			'short_description'   => $addon_list[$matching_addon]['excerpt'],
82 82
 			'slug'                => self::$slug,
83
-			'version'             => $addon_list[ $matching_addon ]['version'],
83
+			'version'             => $addon_list[$matching_addon]['version'],
84 84
 		);
85 85
 
86 86
 		// Splice in the base addon data.
87
-		$inject = array_merge( $inject, $addon_list[ $matching_addon ], $overrides );
87
+		$inject = array_merge( $inject, $addon_list[$matching_addon], $overrides );
88 88
 
89 89
 		// Add it to the top of the list.
90 90
 		array_unshift( $result->plugins, $inject );
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 * @return array
137 137
 	 */
138 138
 	private function get_addons() {
139
-		$api    = new FrmFormApi();
139
+		$api = new FrmFormApi();
140 140
 		return $api->get_api_info();
141 141
 	}
142 142
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
 		$all_plugins = get_plugins();
343 343
 
344
-		return isset( $all_plugins[ $plugin ] );
344
+		return isset( $all_plugins[$plugin] );
345 345
 	}
346 346
 
347 347
 	/**
Please login to merge, or discard this patch.
classes/views/frm-forms/form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 			$grid_helper     = new FrmFieldGridHelper();
31 31
 			$values['count'] = 0;
32 32
 			foreach ( $values['fields'] as $field ) {
33
-				$values['count']++;
33
+				$values['count'] ++;
34 34
 				$grid_helper->set_field( $field );
35 35
 				$grid_helper->maybe_begin_field_wrapper();
36 36
 				FrmFieldsController::load_single_field( $field, $values );
Please login to merge, or discard this patch.
classes/helpers/FrmFieldsHelper.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 			if ( in_array( $type, array( 'data', 'lookup' ) ) ) {
27 27
 				$values['field_options']['data_type'] = $setting;
28 28
 			} else {
29
-				$values['field_options'][ $setting ] = 1;
29
+				$values['field_options'][$setting] = 1;
30 30
 			}
31 31
 		}
32 32
 
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 		}
134 134
 
135 135
 		foreach ( $defaults as $opt => $default ) {
136
-			$values[ $opt ] = isset( $field->field_options[ $opt ] ) ? $field->field_options[ $opt ] : $default;
136
+			$values[$opt] = isset( $field->field_options[$opt] ) ? $field->field_options[$opt] : $default;
137 137
 
138 138
 			if ( $check_post ) {
139
-				self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] );
139
+				self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] );
140 140
 			}
141 141
 
142 142
 			unset( $opt, $default );
@@ -180,20 +180,20 @@  discard block
 block discarded – undo
180 180
 	 * @param mixed $value
181 181
 	 */
182 182
 	private static function get_posted_field_setting( $setting, &$value ) {
183
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) {
183
+		if ( ! isset( $_POST['field_options'][$setting] ) ) {
184 184
 			return;
185 185
 		}
186 186
 
187 187
 		if ( strpos( $setting, 'html' ) !== false ) {
188 188
 			// Strip slashes from HTML but not regex or script tags.
189 189
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
190
-			$value = wp_unslash( $_POST['field_options'][ $setting ] );
190
+			$value = wp_unslash( $_POST['field_options'][$setting] );
191 191
 		} elseif ( strpos( $setting, 'format_' ) === 0 ) {
192 192
 			// TODO: Remove stripslashes on output, and use on input only.
193
-			$value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // WPCS: sanitization ok.
193
+			$value = sanitize_text_field( $_POST['field_options'][$setting] ); // WPCS: sanitization ok.
194 194
 		} else {
195 195
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
196
-			$value = wp_unslash( $_POST['field_options'][ $setting ] );
196
+			$value = wp_unslash( $_POST['field_options'][$setting] );
197 197
 			FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
198 198
 		}
199 199
 	}
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		$values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value );
267 267
 
268 268
 		foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) {
269
-			$values[ $col ] = $field->{$col};
269
+			$values[$col] = $field->{$col};
270 270
 		}
271 271
 	}
272 272
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 		);
307 307
 
308 308
 		$msg = FrmField::get_option( $field, $error );
309
-		$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
309
+		$msg = empty( $msg ) ? $defaults[$error]['part'] : $msg;
310 310
 		$msg = do_shortcode( $msg );
311 311
 
312 312
 		return $msg;
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		}
417 417
 
418 418
 		$base_name = 'default_value_' . $field['id'];
419
-		$html_id    = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
419
+		$html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
420 420
 
421 421
 		$default_type = self::get_default_value_type( $field );
422 422
 
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 				continue;
715 715
 			}
716 716
 
717
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
717
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
718 718
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
719 719
 
720 720
 			$atts['entry'] = $entry;
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 
724 724
 			if ( $replace_with !== null ) {
725 725
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
726
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
726
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
727 727
 			}
728 728
 
729 729
 			unset( $atts, $replace_with );
@@ -766,8 +766,8 @@  discard block
 block discarded – undo
766 766
 
767 767
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' );
768 768
 
769
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
770
-			$replace_with = $shortcode_values[ $atts['tag'] ];
769
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
770
+			$replace_with = $shortcode_values[$atts['tag']];
771 771
 		} elseif ( in_array( $atts['tag'], $dynamic_default ) ) {
772 772
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
773 773
 		} elseif ( $clean_tag == 'user_agent' ) {
@@ -978,8 +978,8 @@  discard block
 block discarded – undo
978 978
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
979 979
 		} elseif ( in_array( $type, $multiple_input ) ) {
980 980
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
981
-		} elseif ( isset( $field_selection[ $type ] ) ) {
982
-			$field_types[ $type ] = $field_selection[ $type ];
981
+		} elseif ( isset( $field_selection[$type] ) ) {
982
+			$field_types[$type] = $field_selection[$type];
983 983
 		}
984 984
 
985 985
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
 
1013 1013
 	private static function field_types_for_input( $inputs, $fields, &$field_types ) {
1014 1014
 		foreach ( $inputs as $input ) {
1015
-			$field_types[ $input ] = $fields[ $input ];
1015
+			$field_types[$input] = $fields[$input];
1016 1016
 			unset( $input );
1017 1017
 		}
1018 1018
 	}
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
 			'parent'  => false,
1045 1045
 			'pointer' => false,
1046 1046
 		);
1047
-		$args     = wp_parse_args( $args, $defaults );
1047
+		$args = wp_parse_args( $args, $defaults );
1048 1048
 
1049 1049
 		$opt_key   = $args['opt_key'];
1050 1050
 		$field     = $args['field'];
@@ -1060,22 +1060,22 @@  discard block
 block discarded – undo
1060 1060
 
1061 1061
 		// Check posted vals before checking saved values
1062 1062
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1063
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) {
1063
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) {
1064 1064
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1065
-				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1065
+				$other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : '';
1066 1066
 			} else {
1067
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) );
1067
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) );
1068 1068
 			}
1069 1069
 
1070 1070
 			return $other_val;
1071 1071
 
1072
-		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) {
1072
+		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) {
1073 1073
 			// For normal fields
1074 1074
 
1075 1075
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1076
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1076
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1077 1077
 			} else {
1078
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) );
1078
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) );
1079 1079
 			}
1080 1080
 
1081 1081
 			return $other_val;
@@ -1085,8 +1085,8 @@  discard block
 block discarded – undo
1085 1085
 		if ( $field['type'] == 'checkbox' && is_array( $field['value'] ) ) {
1086 1086
 			// Check if there is an "other" val in saved value and make sure the
1087 1087
 			// "other" val is not equal to the Other checkbox option
1088
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1089
-				$other_val = $field['value'][ $opt_key ];
1088
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1089
+				$other_val = $field['value'][$opt_key];
1090 1090
 			}
1091 1091
 		} else {
1092 1092
 			/**
@@ -1098,8 +1098,8 @@  discard block
 block discarded – undo
1098 1098
 				// Multi-select dropdowns - key is not preserved
1099 1099
 				if ( is_array( $field['value'] ) ) {
1100 1100
 					$o_key = array_search( $temp_val, $field['value'] );
1101
-					if ( isset( $field['value'][ $o_key ] ) ) {
1102
-						unset( $field['value'][ $o_key ], $o_key );
1101
+					if ( isset( $field['value'][$o_key] ) ) {
1102
+						unset( $field['value'][$o_key], $o_key );
1103 1103
 					}
1104 1104
 				} elseif ( $temp_val == $field['value'] ) {
1105 1105
 					// For radio and regular dropdowns
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
 			return $other_args;
1142 1142
 		}
1143 1143
 
1144
-		$other_opt  = true;
1144
+		$other_opt = true;
1145 1145
 
1146 1146
 		self::set_other_name( $args, $other_args );
1147 1147
 		self::set_other_value( $args, $other_args );
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 		if ( is_array( $val ) ) {
1292 1292
 			foreach ( $val as $k => $v ) {
1293 1293
 				if ( is_string( $v ) ) {
1294
-					$val[ $k ] = str_replace( $replace, $replace_with, $v );
1294
+					$val[$k] = str_replace( $replace, $replace_with, $v );
1295 1295
 					unset( $k, $v );
1296 1296
 				}
1297 1297
 			}
@@ -1630,19 +1630,19 @@  discard block
 block discarded – undo
1630 1630
 	}
1631 1631
 
1632 1632
 	public static function get_bulk_prefilled_opts( array &$prepop ) {
1633
-		$prepop[ __( 'Countries', 'formidable' ) ] = self::get_countries();
1633
+		$prepop[__( 'Countries', 'formidable' )] = self::get_countries();
1634 1634
 
1635 1635
 		$states    = self::get_us_states();
1636 1636
 		$state_abv = array_keys( $states );
1637 1637
 		sort( $state_abv );
1638
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
1638
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
1639 1639
 
1640 1640
 		$states = array_values( $states );
1641 1641
 		sort( $states );
1642
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
1642
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
1643 1643
 		unset( $state_abv, $states );
1644 1644
 
1645
-		$prepop[ __( 'Age', 'formidable' ) ] = array(
1645
+		$prepop[__( 'Age', 'formidable' )] = array(
1646 1646
 			__( 'Under 18', 'formidable' ),
1647 1647
 			__( '18-24', 'formidable' ),
1648 1648
 			__( '25-34', 'formidable' ),
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
 			__( 'Prefer Not to Answer', 'formidable' ),
1654 1654
 		);
1655 1655
 
1656
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = array(
1656
+		$prepop[__( 'Satisfaction', 'formidable' )] = array(
1657 1657
 			__( 'Very Unsatisfied', 'formidable' ),
1658 1658
 			__( 'Unsatisfied', 'formidable' ),
1659 1659
 			__( 'Neutral', 'formidable' ),
@@ -1662,7 +1662,7 @@  discard block
 block discarded – undo
1662 1662
 			__( 'N/A', 'formidable' ),
1663 1663
 		);
1664 1664
 
1665
-		$prepop[ __( 'Importance', 'formidable' ) ] = array(
1665
+		$prepop[__( 'Importance', 'formidable' )] = array(
1666 1666
 			__( 'Not at all Important', 'formidable' ),
1667 1667
 			__( 'Somewhat Important', 'formidable' ),
1668 1668
 			__( 'Neutral', 'formidable' ),
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 			__( 'N/A', 'formidable' ),
1672 1672
 		);
1673 1673
 
1674
-		$prepop[ __( 'Agreement', 'formidable' ) ] = array(
1674
+		$prepop[__( 'Agreement', 'formidable' )] = array(
1675 1675
 			__( 'Strongly Disagree', 'formidable' ),
1676 1676
 			__( 'Disagree', 'formidable' ),
1677 1677
 			__( 'Neutral', 'formidable' ),
@@ -1853,16 +1853,16 @@  discard block
 block discarded – undo
1853 1853
 	 */
1854 1854
 	private static function fill_image_setting_options( $options, &$args ) {
1855 1855
 		foreach ( $options as $key => $option ) {
1856
-			$args['options'][ $key ] = $option;
1856
+			$args['options'][$key] = $option;
1857 1857
 
1858 1858
 			if ( ! empty( $option['addon'] ) ) {
1859
-				$args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
1859
+				$args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
1860 1860
 			}
1861 1861
 
1862
-			unset( $args['options'][ $key ]['addon'] );
1862
+			unset( $args['options'][$key]['addon'] );
1863 1863
 			$fill = array( 'upgrade', 'message', 'content' );
1864 1864
 			foreach ( $fill as $f ) {
1865
-				unset( $args['options'][ $key ][ $f ], $f );
1865
+				unset( $args['options'][$key][$f], $f );
1866 1866
 			}
1867 1867
 		}
1868 1868
 	}
@@ -1883,8 +1883,8 @@  discard block
 block discarded – undo
1883 1883
 
1884 1884
 		$fill = array( 'upgrade', 'message', 'content' );
1885 1885
 		foreach ( $fill as $f ) {
1886
-			if ( isset( $option[ $f ] ) ) {
1887
-				$custom_attrs[ 'data-' . $f ] = $option[ $f ];
1886
+			if ( isset( $option[$f] ) ) {
1887
+				$custom_attrs['data-' . $f] = $option[$f];
1888 1888
 			}
1889 1889
 		}
1890 1890
 
Please login to merge, or discard this patch.