Completed
Pull Request — master (#2513)
by
unknown
42s
created
classes/views/frm-fields/front-end/dropdown-field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 		$opt       = FrmFieldsHelper::get_label_from_array( $opt, $opt_key, $field );
63 63
 		$selected  = FrmAppHelper::check_selected( $field['value'], $field_val );
64 64
 
65
-		$choice_limit_reached = $field_choices_limit_reached_statuses[ $opt_key ];
65
+		$choice_limit_reached = $field_choices_limit_reached_statuses[$opt_key];
66 66
 		$atts                 = isset( $shortcode_atts ) && is_array( $shortcode_atts ) ? $shortcode_atts : array();
67 67
 		if ( FrmFieldsController::should_hide_field_choice( $choice_limit_reached, $atts, $opt_key, $field['form_id'] ) ) {
68 68
 			continue;
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/checkbox-field.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 	$option_index = 0;
26 26
 	foreach ( $field['options'] as $opt_key => $opt ) {
27
-		$choice_limit_reached = $field_choices_limit_reached_statuses[ $opt_key ] ?? false;
27
+		$choice_limit_reached = $field_choices_limit_reached_statuses[$opt_key] ?? false;
28 28
 
29 29
 		$atts = isset( $shortcode_atts ) && is_array( $shortcode_atts ) ? $shortcode_atts : array();
30 30
 		if ( FrmFieldsController::should_hide_field_choice( $choice_limit_reached, $atts, $opt_key, $field['form_id'] ) ) {
@@ -109,6 +109,6 @@  discard block
 block discarded – undo
109 109
 
110 110
 		?></div>
111 111
 <?php
112
-		++$option_index;
112
+		++ $option_index;
113 113
 	}//end foreach
114 114
 }//end if
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/radio-field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 	}
24 24
 
25 25
 	foreach ( $field['options'] as $opt_key => $opt ) {
26
-		$choice_limit_reached = $field_choices_limit_reached_statuses[ $opt_key ] ?? false;
26
+		$choice_limit_reached = $field_choices_limit_reached_statuses[$opt_key] ?? false;
27 27
 
28 28
 		$atts = isset( $shortcode_atts ) && is_array( $shortcode_atts ) ? $shortcode_atts : array();
29 29
 		if ( FrmFieldsController::should_hide_field_choice( $choice_limit_reached, $atts, $opt_key, $field['form_id'] ) ) {
Please login to merge, or discard this patch.
classes/helpers/FrmFieldsHelper.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 			if ( in_array( $type, array( 'data', 'lookup' ), true ) ) {
39 39
 				$values['field_options']['data_type'] = $setting;
40 40
 			} else {
41
-				$values['field_options'][ $setting ] = 1;
41
+				$values['field_options'][$setting] = 1;
42 42
 			}
43 43
 		}
44 44
 
@@ -164,10 +164,10 @@  discard block
 block discarded – undo
164 164
 		}
165 165
 
166 166
 		foreach ( $defaults as $opt => $default ) {
167
-			$values[ $opt ] = $field->field_options[ $opt ] ?? $default;
167
+			$values[$opt] = $field->field_options[$opt] ?? $default;
168 168
 
169 169
 			if ( $check_post ) {
170
-				self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] );
170
+				self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] );
171 171
 			}
172 172
 		}
173 173
 	}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 			return self::$context_is_safe_to_load_field_options_from_request_data;
185 185
 		}
186 186
 
187
-		$function = function () {
187
+		$function = function() {
188 188
 			if ( ! FrmAppHelper::is_admin_page() ) {
189 189
 				return false;
190 190
 			}
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 	 * @param mixed  $value
293 293
 	 */
294 294
 	private static function get_posted_field_setting( $setting, &$value ) {
295
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
295
+		if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
296 296
 			return;
297 297
 		}
298 298
 
299 299
 		if ( strpos( $setting, 'html' ) !== false ) {
300
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
300
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
301 301
 
302 302
 			// Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML.
303 303
 			if ( ! FrmAppHelper::allow_unfiltered_html() ) {
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
 			}
306 306
 		} elseif ( strpos( $setting, 'format_' ) === 0 ) {
307 307
 			// TODO: Remove stripslashes on output, and use on input only.
308
-			$value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
308
+			$value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
309 309
 		} else {
310
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
310
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
311 311
 			FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
312 312
 		}
313 313
 	}
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 		$values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value );
381 381
 
382 382
 		foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) {
383
-			$values[ $col ] = $field->{$col};
383
+			$values[$col] = $field->{$col};
384 384
 		}
385 385
 	}
386 386
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 		$defaults = apply_filters( 'frm_default_field_validation_messages', $defaults, $field );
424 424
 
425 425
 		$msg = FrmField::get_option( $field, $error );
426
-		$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
426
+		$msg = empty( $msg ) ? $defaults[$error]['part'] : $msg;
427 427
 		$msg = do_shortcode( $msg );
428 428
 
429 429
 		$msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field );
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 			'inside_class' => 'inside',
694 694
 			'dismiss-icon' => true,
695 695
 		);
696
-		$args     = array_merge( $defaults, $args );
696
+		$args = array_merge( $defaults, $args );
697 697
 
698 698
 		include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php';
699 699
 	}
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
 				continue;
932 932
 			}
933 933
 
934
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
934
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
935 935
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
936 936
 
937 937
 			$atts['entry'] = $entry;
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 			if ( $replace_with !== null ) {
942 942
 				$replace_with = self::trigger_shortcode_atts( $replace_with, $atts );
943 943
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
944
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
944
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
945 945
 			}
946 946
 
947 947
 			unset( $atts, $replace_with );
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 		$supported_atts = array( 'remove_accents', 'sanitize', 'sanitize_url' );
960 960
 		$included_atts  = array_intersect( $supported_atts, array_keys( $atts ) );
961 961
 		foreach ( $included_atts as $included_att ) {
962
-			if ( '0' === $atts[ $included_att ] ) {
962
+			if ( '0' === $atts[$included_att] ) {
963 963
 				// Skip any option that uses 0 so sanitize_url=0 does not encode.
964 964
 				continue;
965 965
 			}
@@ -1037,8 +1037,8 @@  discard block
 block discarded – undo
1037 1037
 
1038 1038
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' );
1039 1039
 
1040
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
1041
-			$replace_with = $shortcode_values[ $atts['tag'] ];
1040
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
1041
+			$replace_with = $shortcode_values[$atts['tag']];
1042 1042
 		} elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) {
1043 1043
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
1044 1044
 		} elseif ( $clean_tag === 'user_agent' ) {
@@ -1262,8 +1262,8 @@  discard block
 block discarded – undo
1262 1262
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
1263 1263
 		} elseif ( in_array( $type, $multiple_input, true ) ) {
1264 1264
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
1265
-		} elseif ( isset( $field_selection[ $type ] ) ) {
1266
-			$field_types[ $type ] = $field_selection[ $type ];
1265
+		} elseif ( isset( $field_selection[$type] ) ) {
1266
+			$field_types[$type] = $field_selection[$type];
1267 1267
 		}
1268 1268
 
1269 1269
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
 		foreach ( $inputs as $input ) {
1306 1306
 			// This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters.
1307 1307
 			if ( array_key_exists( $input, $fields ) ) {
1308
-				$field_types[ $input ] = $fields[ $input ];
1308
+				$field_types[$input] = $fields[$input];
1309 1309
 			}
1310 1310
 			unset( $input );
1311 1311
 		}
@@ -1338,7 +1338,7 @@  discard block
 block discarded – undo
1338 1338
 			'parent'  => false,
1339 1339
 			'pointer' => false,
1340 1340
 		);
1341
-		$args     = wp_parse_args( $args, $defaults );
1341
+		$args = wp_parse_args( $args, $defaults );
1342 1342
 
1343 1343
 		$opt_key   = $args['opt_key'];
1344 1344
 		$field     = $args['field'];
@@ -1354,25 +1354,25 @@  discard block
 block discarded – undo
1354 1354
 
1355 1355
 		// Check posted vals before checking saved values
1356 1356
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1357
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1357
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1358 1358
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1359 1359
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1360
-				$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 ] ) ) : '';
1360
+				$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] ) ) : '';
1361 1361
 			} else {
1362
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1362
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1363 1363
 			}
1364 1364
 
1365 1365
 			return $other_val;
1366 1366
 		}
1367 1367
 
1368
-		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1368
+		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1369 1369
 			// For normal fields
1370 1370
 
1371 1371
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1372 1372
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1373
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1373
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1374 1374
 			} else {
1375
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1375
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1376 1376
 			}
1377 1377
 
1378 1378
 			return $other_val;
@@ -1382,8 +1382,8 @@  discard block
 block discarded – undo
1382 1382
 		if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) {
1383 1383
 			// Check if there is an "other" val in saved value and make sure the
1384 1384
 			// "other" val is not equal to the Other checkbox option
1385
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1386
-				$other_val = $field['value'][ $opt_key ];
1385
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1386
+				$other_val = $field['value'][$opt_key];
1387 1387
 			}
1388 1388
 		} else {
1389 1389
 			/**
@@ -1395,8 +1395,8 @@  discard block
 block discarded – undo
1395 1395
 				// Multi-select dropdowns - key is not preserved
1396 1396
 				if ( is_array( $field['value'] ) ) {
1397 1397
 					$o_key = array_search( $temp_val, $field['value'] );
1398
-					if ( isset( $field['value'][ $o_key ] ) ) {
1399
-						unset( $field['value'][ $o_key ], $o_key );
1398
+					if ( isset( $field['value'][$o_key] ) ) {
1399
+						unset( $field['value'][$o_key], $o_key );
1400 1400
 					}
1401 1401
 				} elseif ( $temp_val == $field['value'] ) {
1402 1402
 					// For radio and regular dropdowns
@@ -1607,11 +1607,11 @@  discard block
 block discarded – undo
1607 1607
 			foreach ( $val as $k => $v ) {
1608 1608
 				if ( is_string( $v ) ) {
1609 1609
 					if ( 'custom_html' === $k ) {
1610
-						$val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v );
1610
+						$val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v );
1611 1611
 						unset( $k, $v );
1612 1612
 						continue;
1613 1613
 					}
1614
-					$val[ $k ] = str_replace( $replace, $replace_with, $v );
1614
+					$val[$k] = str_replace( $replace, $replace_with, $v );
1615 1615
 					unset( $k, $v );
1616 1616
 				}
1617 1617
 			}
@@ -1640,8 +1640,8 @@  discard block
 block discarded – undo
1640 1640
 			if ( false === $index ) {
1641 1641
 				continue;
1642 1642
 			}
1643
-			unset( $replace[ $index ] );
1644
-			unset( $replace_with[ $index ] );
1643
+			unset( $replace[$index] );
1644
+			unset( $replace_with[$index] );
1645 1645
 		}
1646 1646
 		$value = str_replace( $replace, $replace_with, $value );
1647 1647
 		return $value;
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
 			$countries['class'] = 'frm-countries-opts';
1990 1990
 		}
1991 1991
 
1992
-		$prepop[ __( 'Countries', 'formidable' ) ] = $countries;
1992
+		$prepop[__( 'Countries', 'formidable' )] = $countries;
1993 1993
 
1994 1994
 		// State abv.
1995 1995
 		$states    = self::get_us_states();
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
 			$state_abv['class'] = 'frm-state-abv-opts';
2000 2000
 		}
2001 2001
 
2002
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
2002
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
2003 2003
 
2004 2004
 		// States.
2005 2005
 		$states = array_values( $states );
@@ -2008,7 +2008,7 @@  discard block
 block discarded – undo
2008 2008
 			$states['class'] = 'frm-states-opts';
2009 2009
 		}
2010 2010
 
2011
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
2011
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
2012 2012
 		unset( $state_abv, $states );
2013 2013
 
2014 2014
 		// Age.
@@ -2026,7 +2026,7 @@  discard block
 block discarded – undo
2026 2026
 			$ages['class'] = 'frm-age-opts';
2027 2027
 		}
2028 2028
 
2029
-		$prepop[ __( 'Age', 'formidable' ) ] = $ages;
2029
+		$prepop[__( 'Age', 'formidable' )] = $ages;
2030 2030
 
2031 2031
 		// Satisfaction.
2032 2032
 		$satisfaction = array(
@@ -2041,7 +2041,7 @@  discard block
 block discarded – undo
2041 2041
 			$satisfaction['class'] = 'frm-satisfaction-opts';
2042 2042
 		}
2043 2043
 
2044
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction;
2044
+		$prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction;
2045 2045
 
2046 2046
 		// Importance.
2047 2047
 		$importance = array(
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 			$importance['class'] = 'frm-importance-opts';
2057 2057
 		}
2058 2058
 
2059
-		$prepop[ __( 'Importance', 'formidable' ) ] = $importance;
2059
+		$prepop[__( 'Importance', 'formidable' )] = $importance;
2060 2060
 
2061 2061
 		// Agreement.
2062 2062
 		$agreement = array(
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
 			$agreement['class'] = 'frm-agreement-opts';
2072 2072
 		}
2073 2073
 
2074
-		$prepop[ __( 'Agreement', 'formidable' ) ] = $agreement;
2074
+		$prepop[__( 'Agreement', 'formidable' )] = $agreement;
2075 2075
 
2076 2076
 		// Likely.
2077 2077
 		$likely = array(
@@ -2086,7 +2086,7 @@  discard block
 block discarded – undo
2086 2086
 			$likely['class'] = 'frm-likely-opts';
2087 2087
 		}
2088 2088
 
2089
-		$prepop[ __( 'Likely', 'formidable' ) ] = $likely;
2089
+		$prepop[__( 'Likely', 'formidable' )] = $likely;
2090 2090
 
2091 2091
 		$prepop = apply_filters( 'frm_bulk_field_choices', $prepop );
2092 2092
 	}
@@ -2307,16 +2307,16 @@  discard block
 block discarded – undo
2307 2307
 	 */
2308 2308
 	private static function fill_image_setting_options( $options, &$args ) {
2309 2309
 		foreach ( $options as $key => $option ) {
2310
-			$args['options'][ $key ] = $option;
2310
+			$args['options'][$key] = $option;
2311 2311
 
2312 2312
 			if ( ! empty( $option['addon'] ) ) {
2313
-				$args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2313
+				$args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2314 2314
 			}
2315 2315
 
2316
-			unset( $args['options'][ $key ]['addon'] );
2316
+			unset( $args['options'][$key]['addon'] );
2317 2317
 			$fill = array( 'upgrade', 'message', 'content' );
2318 2318
 			foreach ( $fill as $f ) {
2319
-				unset( $args['options'][ $key ][ $f ], $f );
2319
+				unset( $args['options'][$key][$f], $f );
2320 2320
 			}
2321 2321
 		}
2322 2322
 	}
@@ -2337,8 +2337,8 @@  discard block
 block discarded – undo
2337 2337
 
2338 2338
 		$fill = array( 'upgrade', 'message', 'content' );
2339 2339
 		foreach ( $fill as $f ) {
2340
-			if ( isset( $option[ $f ] ) ) {
2341
-				$custom_attrs[ 'data-' . $f ] = $option[ $f ];
2340
+			if ( isset( $option[$f] ) ) {
2341
+				$custom_attrs['data-' . $f] = $option[$f];
2342 2342
 			}
2343 2343
 		}
2344 2344
 
@@ -2404,7 +2404,7 @@  discard block
 block discarded – undo
2404 2404
 
2405 2405
 		return array_filter(
2406 2406
 			$rows,
2407
-			function ( $row ) {
2407
+			function( $row ) {
2408 2408
 				FrmAppHelper::unserialize_or_decode( $row->field_options );
2409 2409
 				return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] );
2410 2410
 			}
@@ -2467,7 +2467,7 @@  discard block
 block discarded – undo
2467 2467
 		if ( empty( $attributes['data-fid'] ) ) {
2468 2468
 			unset( $data['plugin-status'] );
2469 2469
 			foreach ( $data as $key => $value ) {
2470
-				$attributes[ 'data-' . $key ] = $value;
2470
+				$attributes['data-' . $key] = $value;
2471 2471
 			}
2472 2472
 		}
2473 2473
 
Please login to merge, or discard this patch.
classes/controllers/FrmFieldsController.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$_GET['page'] = 'formidable';
27 27
 
28
-		$values     = array(
28
+		$values = array(
29 29
 			'id'         => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ),
30 30
 			'doing_ajax' => true,
31 31
 		);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 			ob_start();
50 50
 			self::load_single_field( $field, $values );
51
-			$field_html[ absint( $field->id ) ] = ob_get_contents();
51
+			$field_html[absint( $field->id )] = ob_get_contents();
52 52
 			ob_end_clean();
53 53
 		}
54 54
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			foreach ( $opts as $opt_key => $opt ) {
281 281
 				if ( strpos( $opt, '|' ) !== false ) {
282 282
 					$vals             = explode( '|', $opt );
283
-					$opts[ $opt_key ] = array(
283
+					$opts[$opt_key] = array(
284 284
 						'label' => trim( $vals[0] ),
285 285
 						'value' => trim( $vals[1] ),
286 286
 					);
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 			$other_array = array();
296 296
 			foreach ( $field['options'] as $opt_key => $opt ) {
297 297
 				if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) {
298
-					$other_array[ $opt_key ] = $opt;
298
+					$other_array[$opt_key] = $opt;
299 299
 				}
300 300
 				unset( $opt_key, $opt );
301 301
 			}
@@ -338,18 +338,18 @@  discard block
 block discarded – undo
338 338
 		$frm_settings         = FrmAppHelper::get_settings();
339 339
 		$field_types          = FrmFieldTypeOptionData::get_field_types( $field['type'] );
340 340
 
341
-		if ( ! isset( $all_field_types[ $field['type'] ] ) ) {
341
+		if ( ! isset( $all_field_types[$field['type']] ) ) {
342 342
 			// Add fallback for an add-on field type that has been deactivated.
343
-			$all_field_types[ $field['type'] ] = array(
343
+			$all_field_types[$field['type']] = array(
344 344
 				'name' => ucfirst( $field['type'] ),
345 345
 				'icon' => 'frm_icon_font frm_pencil_icon',
346 346
 			);
347
-		} elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) {
347
+		} elseif ( ! is_array( $all_field_types[$field['type']] ) ) {
348 348
 			// Fallback for fields added in a more basic way.
349
-			FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] );
349
+			FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] );
350 350
 		}
351 351
 
352
-		$type_name = $all_field_types[ $field['type'] ]['name'];
352
+		$type_name = $all_field_types[$field['type']]['name'];
353 353
 		if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) {
354 354
 			$type_name = $all_field_types['divider|repeat']['name'];
355 355
 		}
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 
487 487
 		$choices_limit_reached_statuses = array();
488 488
 		foreach ( $field['options'] as $opt_key => $opt ) {
489
-			$choices_limit_reached_statuses[ $opt_key ] = self::choice_limit_reached( $field, $opt_key );
489
+			$choices_limit_reached_statuses[$opt_key] = self::choice_limit_reached( $field, $opt_key );
490 490
 		}
491 491
 		return $choices_limit_reached_statuses;
492 492
 	}
@@ -540,14 +540,14 @@  discard block
 block discarded – undo
540 540
 
541 541
 		if ( FrmAppHelper::pro_is_connected() ) {
542 542
 			foreach ( $settings as $type ) {
543
-				if ( ! empty( $field[ $type ] ) ) {
543
+				if ( ! empty( $field[$type] ) ) {
544 544
 					$active = $type;
545 545
 				}
546 546
 			}
547 547
 		}
548 548
 
549
-		$types[ $active ]['class']  .= ' current';
550
-		$types[ $active ]['current'] = true;
549
+		$types[$active]['class']  .= ' current';
550
+		$types[$active]['current'] = true;
551 551
 
552 552
 		return $types;
553 553
 	}
@@ -565,8 +565,8 @@  discard block
 block discarded – undo
565 565
 			'website' => 'url',
566 566
 			'image'   => 'url',
567 567
 		);
568
-		if ( isset( $type_switch[ $type ] ) ) {
569
-			$type = $type_switch[ $type ];
568
+		if ( isset( $type_switch[$type] ) ) {
569
+			$type = $type_switch[$type];
570 570
 		}
571 571
 
572 572
 		$pro_fields = FrmField::pro_field_selection();
@@ -721,11 +721,11 @@  discard block
 block discarded – undo
721 721
 		// include "col" for valid html
722 722
 		$unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) );
723 723
 
724
-		if ( ! isset( $calc[ $unit ] ) ) {
724
+		if ( ! isset( $calc[$unit] ) ) {
725 725
 			return;
726 726
 		}
727 727
 
728
-		$size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ];
728
+		$size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit];
729 729
 
730 730
 		$add_html['cols'] = 'cols="' . absint( $size ) . '"';
731 731
 	}
@@ -958,11 +958,11 @@  discard block
 block discarded – undo
958 958
 	private static function get_form_for_js_validation( $field ) {
959 959
 		global $frm_vars;
960 960
 		if ( ! empty( $frm_vars['js_validate_forms'] ) ) {
961
-			if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) {
962
-				return $frm_vars['js_validate_forms'][ $field['form_id'] ];
961
+			if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) {
962
+				return $frm_vars['js_validate_forms'][$field['form_id']];
963 963
 			}
964
-			if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) {
965
-				return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ];
964
+			if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) {
965
+				return $frm_vars['js_validate_forms'][$field['parent_form_id']];
966 966
 			}
967 967
 		}
968 968
 		return false;
@@ -1049,13 +1049,13 @@  discard block
 block discarded – undo
1049 1049
 		foreach ( $field['shortcodes'] as $k => $v ) {
1050 1050
 			if ( isset( $field['subfield_name'] ) && 0 === strpos( $k, 'aria-invalid' ) ) {
1051 1051
 				$subfield_name = $field['subfield_name'];
1052
-				if ( ! isset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ) ) {
1052
+				if ( ! isset( $field['shortcodes']['aria-invalid-' . $subfield_name] ) ) {
1053 1053
 					continue;
1054 1054
 				}
1055 1055
 				// Change the key to the correct aria-invalid value so that $add_html is set correctly for the current subfield of a combo field.
1056 1056
 				$k = 'aria-invalid';
1057
-				$v = $field['shortcodes'][ 'aria-invalid-' . $subfield_name ];
1058
-				unset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] );
1057
+				$v = $field['shortcodes']['aria-invalid-' . $subfield_name];
1058
+				unset( $field['shortcodes']['aria-invalid-' . $subfield_name] );
1059 1059
 			}
1060 1060
 			if ( 'opt' === $k || ! self::should_allow_input_attribute( $k ) ) {
1061 1061
 				continue;
@@ -1063,10 +1063,10 @@  discard block
 block discarded – undo
1063 1063
 
1064 1064
 			if ( is_numeric( $k ) && strpos( $v, '=' ) ) {
1065 1065
 				$add_html[] = $v;
1066
-			} elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) {
1067
-				$add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] );
1066
+			} elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) {
1067
+				$add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] );
1068 1068
 			} else {
1069
-				$add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"';
1069
+				$add_html[$k] = $k . '="' . esc_attr( $v ) . '"';
1070 1070
 			}
1071 1071
 
1072 1072
 			unset( $k, $v );
Please login to merge, or discard this patch.