Completed
Pull Request — master (#577)
by Stephanie
42s
created
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   +44 added lines, -44 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
 			}
@@ -1644,7 +1644,7 @@  discard block
 block discarded – undo
1644 1644
 			$countries['class'] = 'frm-countries-opts';
1645 1645
 		}
1646 1646
 
1647
-		$prepop[ __( 'Countries', 'formidable' ) ] = $countries;
1647
+		$prepop[__( 'Countries', 'formidable' )] = $countries;
1648 1648
 
1649 1649
 		// State abv.
1650 1650
 		$states    = self::get_us_states();
@@ -1654,7 +1654,7 @@  discard block
 block discarded – undo
1654 1654
 			$state_abv['class'] = 'frm-state-abv-opts';
1655 1655
 		}
1656 1656
 
1657
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
1657
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
1658 1658
 
1659 1659
 		// States.
1660 1660
 		$states = array_values( $states );
@@ -1663,7 +1663,7 @@  discard block
 block discarded – undo
1663 1663
 			$states['class'] = 'frm-states-opts';
1664 1664
 		}
1665 1665
 
1666
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
1666
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
1667 1667
 		unset( $state_abv, $states );
1668 1668
 
1669 1669
 		// Age.
@@ -1681,7 +1681,7 @@  discard block
 block discarded – undo
1681 1681
 			$ages['class'] = 'frm-age-opts';
1682 1682
 		}
1683 1683
 
1684
-		$prepop[ __( 'Age', 'formidable' ) ] = $ages;
1684
+		$prepop[__( 'Age', 'formidable' )] = $ages;
1685 1685
 
1686 1686
 		// Satisfaction.
1687 1687
 		$satisfaction = array(
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
 			$satisfaction['class'] = 'frm-satisfaction-opts';
1697 1697
 		}
1698 1698
 
1699
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction;
1699
+		$prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction;
1700 1700
 
1701 1701
 		// Importance.
1702 1702
 		$importance = array(
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 			$importance['class'] = 'frm-importance-opts';
1712 1712
 		}
1713 1713
 
1714
-		$prepop[ __( 'Importance', 'formidable' ) ] = $importance;
1714
+		$prepop[__( 'Importance', 'formidable' )] = $importance;
1715 1715
 
1716 1716
 		// Agreement.
1717 1717
 		$agreement = array(
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
 			$agreement['class'] = 'frm-agreement-opts';
1727 1727
 		}
1728 1728
 
1729
-		$prepop[ __( 'Agreement', 'formidable' ) ] = $agreement;
1729
+		$prepop[__( 'Agreement', 'formidable' )] = $agreement;
1730 1730
 
1731 1731
 		// Likely.
1732 1732
 		$likely = array(
@@ -1741,7 +1741,7 @@  discard block
 block discarded – undo
1741 1741
 			$likely['class'] = 'frm-likely-opts';
1742 1742
 		}
1743 1743
 
1744
-		$prepop[ __( 'Likely', 'formidable' ) ] = $likely;
1744
+		$prepop[__( 'Likely', 'formidable' )] = $likely;
1745 1745
 
1746 1746
 		$prepop = apply_filters( 'frm_bulk_field_choices', $prepop );
1747 1747
 	}
@@ -1916,16 +1916,16 @@  discard block
 block discarded – undo
1916 1916
 	 */
1917 1917
 	private static function fill_image_setting_options( $options, &$args ) {
1918 1918
 		foreach ( $options as $key => $option ) {
1919
-			$args['options'][ $key ] = $option;
1919
+			$args['options'][$key] = $option;
1920 1920
 
1921 1921
 			if ( ! empty( $option['addon'] ) ) {
1922
-				$args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
1922
+				$args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
1923 1923
 			}
1924 1924
 
1925
-			unset( $args['options'][ $key ]['addon'] );
1925
+			unset( $args['options'][$key]['addon'] );
1926 1926
 			$fill = array( 'upgrade', 'message', 'content' );
1927 1927
 			foreach ( $fill as $f ) {
1928
-				unset( $args['options'][ $key ][ $f ], $f );
1928
+				unset( $args['options'][$key][$f], $f );
1929 1929
 			}
1930 1930
 		}
1931 1931
 	}
@@ -1946,8 +1946,8 @@  discard block
 block discarded – undo
1946 1946
 
1947 1947
 		$fill = array( 'upgrade', 'message', 'content' );
1948 1948
 		foreach ( $fill as $f ) {
1949
-			if ( isset( $option[ $f ] ) ) {
1950
-				$custom_attrs[ 'data-' . $f ] = $option[ $f ];
1949
+			if ( isset( $option[$f] ) ) {
1950
+				$custom_attrs['data-' . $f] = $option[$f];
1951 1951
 			}
1952 1952
 		}
1953 1953
 
Please login to merge, or discard this patch.
classes/widgets/FrmElementorWidget.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 
87 87
 			foreach ( $forms as $form ) {
88 88
 				$form_title           = '' === $form->name ? __( '(no title)', 'formidable' ) : FrmAppHelper::truncate( $form->name, 50 );
89
-				$options[ $form->id ] = esc_html( $form_title );
89
+				$options[$form->id] = esc_html( $form_title );
90 90
 			}
91 91
 
92 92
 			return $options;
Please login to merge, or discard this patch.
classes/controllers/FrmFieldsController.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 		$_GET['page'] = 'formidable';
20 20
 
21
-		$values     = array(
21
+		$values = array(
22 22
 			'id'         => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ),
23 23
 			'doing_ajax' => true,
24 24
 		);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 			ob_start();
43 43
 			self::load_single_field( $field, $values );
44
-			$field_html[ absint( $field->id ) ] = ob_get_contents();
44
+			$field_html[absint( $field->id )] = ob_get_contents();
45 45
 			ob_end_clean();
46 46
 		}
47 47
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 			foreach ( $opts as $opt_key => $opt ) {
257 257
 				if ( strpos( $opt, '|' ) !== false ) {
258 258
 					$vals = explode( '|', $opt );
259
-					$opts[ $opt_key ] = array(
259
+					$opts[$opt_key] = array(
260 260
 						'label' => trim( $vals[0] ),
261 261
 						'value' => trim( $vals[1] ),
262 262
 					);
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 			$other_array = array();
272 272
 			foreach ( $field['options'] as $opt_key => $opt ) {
273 273
 				if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) {
274
-					$other_array[ $opt_key ] = $opt;
274
+					$other_array[$opt_key] = $opt;
275 275
 				}
276 276
 				unset( $opt_key, $opt );
277 277
 			}
@@ -313,18 +313,18 @@  discard block
 block discarded – undo
313 313
 		$disabled_fields     = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection;
314 314
 		$frm_settings        = FrmAppHelper::get_settings();
315 315
 
316
-		if ( ! isset( $all_field_types[ $field['type'] ] ) ) {
316
+		if ( ! isset( $all_field_types[$field['type']] ) ) {
317 317
 			// Add fallback for an add-on field type that has been deactivated.
318
-			$all_field_types[ $field['type'] ] = array(
318
+			$all_field_types[$field['type']] = array(
319 319
 				'name' => ucfirst( $field['type'] ),
320 320
 				'icon' => 'frm_icon_font frm_pencil_icon',
321 321
 			);
322
-		} elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) {
322
+		} elseif ( ! is_array( $all_field_types[$field['type']] ) ) {
323 323
 			// Fallback for fields added in a more basic way.
324
-			FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] );
324
+			FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] );
325 325
 		}
326 326
 
327
-		$type_name = $all_field_types[ $field['type'] ]['name'];
327
+		$type_name = $all_field_types[$field['type']]['name'];
328 328
 		if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) {
329 329
 			$type_name = $all_field_types['divider|repeat']['name'];
330 330
 		}
@@ -387,13 +387,13 @@  discard block
 block discarded – undo
387 387
 		$active   = 'default_value';
388 388
 
389 389
 		foreach ( $settings as $type ) {
390
-			if ( ! empty( $field[ $type ] ) ) {
390
+			if ( ! empty( $field[$type] ) ) {
391 391
 				$active = $type;
392 392
 			}
393 393
 		}
394 394
 
395
-		$types[ $active ]['class']  .= ' current';
396
-		$types[ $active ]['current'] = true;
395
+		$types[$active]['class']  .= ' current';
396
+		$types[$active]['current'] = true;
397 397
 
398 398
 		return $types;
399 399
 	}
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
 			'website' => 'url',
408 408
 			'image'   => 'url',
409 409
 		);
410
-		if ( isset( $type_switch[ $type ] ) ) {
411
-			$type = $type_switch[ $type ];
410
+		if ( isset( $type_switch[$type] ) ) {
411
+			$type = $type_switch[$type];
412 412
 		}
413 413
 
414 414
 		$pro_fields = FrmField::pro_field_selection();
@@ -532,11 +532,11 @@  discard block
 block discarded – undo
532 532
 		// include "col" for valid html
533 533
 		$unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) );
534 534
 
535
-		if ( ! isset( $calc[ $unit ] ) ) {
535
+		if ( ! isset( $calc[$unit] ) ) {
536 536
 			return;
537 537
 		}
538 538
 
539
-		$size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ];
539
+		$size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit];
540 540
 
541 541
 		$add_html['cols'] = 'cols="' . absint( $size ) . '"';
542 542
 	}
@@ -729,11 +729,11 @@  discard block
 block discarded – undo
729 729
 	private static function get_form_for_js_validation( $field ) {
730 730
 		global $frm_vars;
731 731
 		if ( ! empty( $frm_vars['js_validate_forms'] ) ) {
732
-			if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) {
733
-				return $frm_vars['js_validate_forms'][ $field['form_id'] ];
732
+			if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) {
733
+				return $frm_vars['js_validate_forms'][$field['form_id']];
734 734
 			}
735
-			if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) {
736
-				return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ];
735
+			if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) {
736
+				return $frm_vars['js_validate_forms'][$field['parent_form_id']];
737 737
 			}
738 738
 		}
739 739
 		return false;
@@ -804,10 +804,10 @@  discard block
 block discarded – undo
804 804
 
805 805
 			if ( is_numeric( $k ) && strpos( $v, '=' ) ) {
806 806
 				$add_html[] = $v;
807
-			} elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) {
808
-				$add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] );
807
+			} elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) {
808
+				$add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] );
809 809
 			} else {
810
-				$add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"';
810
+				$add_html[$k] = $k . '="' . esc_attr( $v ) . '"';
811 811
 			}
812 812
 
813 813
 			unset( $k, $v );
Please login to merge, or discard this patch.
classes/models/FrmEntry.php 1 patch
Spacing   +18 added lines, -18 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,7 +457,7 @@  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 ) ) {
@@ -501,16 +501,16 @@  discard block
 block discarded – undo
501 501
 		}
502 502
 
503 503
 		foreach ( $metas as $m_key => $meta_val ) {
504
-			if ( ! isset( $entries[ $meta_val->item_id ] ) ) {
504
+			if ( ! isset( $entries[$meta_val->item_id] ) ) {
505 505
 				continue;
506 506
 			}
507 507
 
508
-			if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) {
509
-				$entries[ $meta_val->item_id ]->metas = array();
508
+			if ( ! isset( $entries[$meta_val->item_id]->metas ) ) {
509
+				$entries[$meta_val->item_id]->metas = array();
510 510
 			}
511 511
 
512 512
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
513
-			$entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value;
513
+			$entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value;
514 514
 			unset( $m_key, $meta_val );
515 515
 		}
516 516
 
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 	}
689 689
 
690 690
 	private static function get_entry_value( $values, $name, $default ) {
691
-		return isset( $values[ $name ] ) ? $values[ $name ] : $default;
691
+		return isset( $values[$name] ) ? $values[$name] : $default;
692 692
 	}
693 693
 
694 694
 	/**
Please login to merge, or discard this patch.
classes/controllers/FrmEntriesController.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -75,19 +75,19 @@  discard block
 block discarded – undo
75 75
 		global $frm_vars;
76 76
 		$form_id = FrmForm::get_current_form_id();
77 77
 
78
-		$columns[ $form_id . '_id' ]       = 'ID';
79
-		$columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' );
78
+		$columns[$form_id . '_id']       = 'ID';
79
+		$columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' );
80 80
 
81 81
 		if ( $form_id ) {
82 82
 			self::get_columns_for_form( $form_id, $columns );
83 83
 		} else {
84
-			$columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' );
85
-			$columns[ $form_id . '_name' ]    = __( 'Entry Name', 'formidable' );
86
-			$columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' );
84
+			$columns[$form_id . '_form_id'] = __( 'Form', 'formidable' );
85
+			$columns[$form_id . '_name']    = __( 'Entry Name', 'formidable' );
86
+			$columns[$form_id . '_user_id'] = __( 'Created By', 'formidable' );
87 87
 		}
88 88
 
89
-		$columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
90
-		$columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
89
+		$columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' );
90
+		$columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' );
91 91
 		self::maybe_add_ip_col( $form_id, $columns );
92 92
 
93 93
 		$frm_vars['cols'] = $columns;
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 
136 136
 		foreach ( $sub_form_cols as $k => $sub_form_col ) {
137 137
 			if ( FrmField::is_no_save_field( $sub_form_col->type ) ) {
138
-				unset( $sub_form_cols[ $k ] );
138
+				unset( $sub_form_cols[$k] );
139 139
 				continue;
140 140
 			}
141
-			$columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
141
+			$columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
142 142
 			unset( $sub_form_col );
143 143
 		}
144 144
 	}
@@ -155,15 +155,15 @@  discard block
 block discarded – undo
155 155
 		$has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' );
156 156
 		$is_post_status     = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] == 'post_status';
157 157
 		if ( $has_separate_value && ! $is_post_status ) {
158
-			$columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
158
+			$columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 );
159 159
 		}
160 160
 
161
-		$columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
161
+		$columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 );
162 162
 	}
163 163
 
164 164
 	private static function maybe_add_ip_col( $form_id, &$columns ) {
165 165
 		if ( FrmAppHelper::ips_saved() ) {
166
-			$columns[ $form_id . '_ip' ] = 'IP';
166
+			$columns[$form_id . '_ip'] = 'IP';
167 167
 		}
168 168
 	}
169 169
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 		foreach ( $meta_value as $mk => $mv ) {
202 202
 			// Remove blank values.
203 203
 			if ( empty( $mv ) ) {
204
-				unset( $meta_value[ $mk ] );
204
+				unset( $meta_value[$mk] );
205 205
 			}
206 206
 		}
207 207
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
 		foreach ( $fields as $field ) {
279 279
 			if ( self::field_supports_sorting( $field ) ) {
280
-				$columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
280
+				$columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id;
281 281
 			}
282 282
 		}
283 283
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			$atts['form_id'] . '_item_key' => '',
354 354
 			$atts['form_id'] . '_id'       => '',
355 355
 		);
356
-		$cols         = $remove_first + array_reverse( $frm_vars['cols'], true );
356
+		$cols = $remove_first + array_reverse( $frm_vars['cols'], true );
357 357
 
358 358
 		$i = $atts['i'];
359 359
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
 			if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) {
366 366
 				$result[] = $col_key;
367
-				$i--;
367
+				$i --;
368 368
 			}
369 369
 
370 370
 			unset( $col_key, $col );
@@ -497,9 +497,9 @@  discard block
 block discarded – undo
497 497
 		if ( ! isset( $frm_vars['form_params'] ) ) {
498 498
 			$frm_vars['form_params'] = array();
499 499
 		}
500
-		$frm_vars['form_params'][ $form->id ] = $params;
500
+		$frm_vars['form_params'][$form->id] = $params;
501 501
 
502
-		if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
502
+		if ( isset( $frm_vars['created_entries'][$form_id] ) ) {
503 503
 			return;
504 504
 		}
505 505
 
@@ -515,16 +515,16 @@  discard block
 block discarded – undo
515 515
 		 */
516 516
 		$errors = apply_filters( 'frm_entries_before_create', $errors, $form );
517 517
 
518
-		$frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
518
+		$frm_vars['created_entries'][$form_id] = array( 'errors' => $errors );
519 519
 
520 520
 		if ( empty( $errors ) ) {
521 521
 			$_POST['frm_skip_cookie'] = 1;
522 522
 			$do_success               = false;
523 523
 			if ( $params['action'] == 'create' ) {
524
-				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
525
-					$frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
524
+				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) {
525
+					$frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST );
526 526
 
527
-					$params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id'];
527
+					$params['id'] = $frm_vars['created_entries'][$form_id]['entry_id'];
528 528
 					$do_success   = true;
529 529
 				}
530 530
 			}
Please login to merge, or discard this patch.
classes/models/FrmField.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		$values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) );
235 235
 
236 236
 		foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) {
237
-			$new_values[ $col ] = $values[ $col ];
237
+			$new_values[$col] = $values[$col];
238 238
 		}
239 239
 
240 240
 		$new_values['options']       = self::maybe_filter_options( $values['options'] );
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		$new_values['created_at']    = current_time( 'mysql', 1 );
246 246
 
247 247
 		if ( isset( $values['id'] ) ) {
248
-			$frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key'];
248
+			$frm_duplicate_ids[$values['field_key']] = $new_values['field_key'];
249 249
 			$new_values                                = apply_filters( 'frm_duplicated_field', $new_values );
250 250
 		}
251 251
 
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
 		foreach ( $new_values as $k => $v ) {
255 255
 			if ( is_array( $v ) ) {
256 256
 				if ( $k === 'default_value' ) {
257
-					$new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v );
257
+					$new_values[$k] = FrmAppHelper::maybe_json_encode( $v );
258 258
 				} else {
259
-					$new_values[ $k ] = serialize( $v );
259
+					$new_values[$k] = serialize( $v );
260 260
 				}
261 261
 			}
262 262
 			unset( $k, $v );
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
 		if ( $query_results ) {
277 277
 			if ( isset( $values['id'] ) ) {
278
-				$frm_duplicate_ids[ $values['id'] ] = $new_id;
278
+				$frm_duplicate_ids[$values['id']] = $new_id;
279 279
 			}
280 280
 
281 281
 			return $new_id;
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) {
339 339
 		global $frm_duplicate_ids;
340 340
 
341
-		$where  = array(
341
+		$where = array(
342 342
 			array(
343 343
 				'or'                => 1,
344 344
 				'fi.form_id'        => $old_form_id,
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
 
385 385
 			$values                                 = apply_filters( 'frm_duplicated_field', $values );
386 386
 			$new_id                                 = self::create( $values );
387
-			$frm_duplicate_ids[ $field->id ]        = $new_id;
388
-			$frm_duplicate_ids[ $field->field_key ] = $new_id;
387
+			$frm_duplicate_ids[$field->id]        = $new_id;
388
+			$frm_duplicate_ids[$field->field_key] = $new_id;
389 389
 			unset( $field );
390 390
 		}
391 391
 	}
@@ -417,11 +417,11 @@  discard block
 block discarded – undo
417 417
 
418 418
 		// serialize array values
419 419
 		foreach ( array( 'field_options', 'options' ) as $opt ) {
420
-			if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) {
420
+			if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) {
421 421
 				if ( 'field_options' === $opt ) {
422
-					$values[ $opt ] = self::maybe_filter_options( $values[ $opt ] );
422
+					$values[$opt] = self::maybe_filter_options( $values[$opt] );
423 423
 				}
424
-				$values[ $opt ] = serialize( $values[ $opt ] );
424
+				$values[$opt] = serialize( $values[$opt] );
425 425
 			}
426 426
 		}
427 427
 		if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) {
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 				'id'        => $id,
574 574
 				'field_key' => $id,
575 575
 			);
576
-			$type  = FrmDb::get_var( 'frm_fields', $where, $col );
576
+			$type = FrmDb::get_var( 'frm_fields', $where, $col );
577 577
 		}
578 578
 
579 579
 		return $type;
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 					continue;
600 600
 				}
601 601
 
602
-				$fields[ $result->id ] = $result;
602
+				$fields[$result->id] = $result;
603 603
 				$count ++;
604 604
 				if ( $limit == 1 ) {
605 605
 					$fields = $result;
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 			$count  = 0;
646 646
 			foreach ( $results as $result ) {
647 647
 				$count ++;
648
-				$fields[ $result->id ] = $result;
648
+				$fields[$result->id] = $result;
649 649
 				if ( ! empty( $limit ) && $count >= $limit ) {
650 650
 					break;
651 651
 				}
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 			}
715 715
 
716 716
 			if ( ! empty( $sub_fields ) ) {
717
-				$index        = $k + $index_offset;
717
+				$index = $k + $index_offset;
718 718
 				$index_offset += count( $sub_fields );
719 719
 				array_splice( $results, $index, 0, $sub_fields );
720 720
 			}
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 		$query_type = ( $limit == ' LIMIT 1' || $limit == 1 ) ? 'row' : 'results';
760 760
 
761 761
 		if ( is_array( $where ) ) {
762
-			$args    = array(
762
+			$args = array(
763 763
 				'order_by' => $order_by,
764 764
 				'limit'    => $limit,
765 765
 			);
@@ -790,9 +790,9 @@  discard block
 block discarded – undo
790 790
 				FrmDb::set_cache( $result->field_key, $result, 'frm_field' );
791 791
 
792 792
 				self::prepare_options( $result );
793
-				$results[ $r_key ]->field_options = $result->field_options;
794
-				$results[ $r_key ]->options       = $result->options;
795
-				$results[ $r_key ]->default_value = $result->default_value;
793
+				$results[$r_key]->field_options = $result->field_options;
794
+				$results[$r_key]->options       = $result->options;
795
+				$results[$r_key]->default_value = $result->default_value;
796 796
 
797 797
 				unset( $r_key, $result );
798 798
 			}
@@ -994,23 +994,23 @@  discard block
 block discarded – undo
994 994
 	}
995 995
 
996 996
 	public static function is_option_true_in_array( $field, $option ) {
997
-		return isset( $field[ $option ] ) && $field[ $option ];
997
+		return isset( $field[$option] ) && $field[$option];
998 998
 	}
999 999
 
1000 1000
 	public static function is_option_true_in_object( $field, $option ) {
1001
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ];
1001
+		return isset( $field->field_options[$option] ) && $field->field_options[$option];
1002 1002
 	}
1003 1003
 
1004 1004
 	public static function is_option_empty_in_array( $field, $option ) {
1005
-		return ! isset( $field[ $option ] ) || empty( $field[ $option ] );
1005
+		return ! isset( $field[$option] ) || empty( $field[$option] );
1006 1006
 	}
1007 1007
 
1008 1008
 	public static function is_option_empty_in_object( $field, $option ) {
1009
-		return ! isset( $field->field_options[ $option ] ) || empty( $field->field_options[ $option ] );
1009
+		return ! isset( $field->field_options[$option] ) || empty( $field->field_options[$option] );
1010 1010
 	}
1011 1011
 
1012 1012
 	public static function is_option_value_in_object( $field, $option ) {
1013
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != '';
1013
+		return isset( $field->field_options[$option] ) && $field->field_options[$option] != '';
1014 1014
 	}
1015 1015
 
1016 1016
 	/**
@@ -1028,10 +1028,10 @@  discard block
 block discarded – undo
1028 1028
 
1029 1029
 	public static function get_option_in_array( $field, $option ) {
1030 1030
 
1031
-		if ( isset( $field[ $option ] ) ) {
1032
-			$this_option = $field[ $option ];
1033
-		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) {
1034
-			$this_option = $field['field_options'][ $option ];
1031
+		if ( isset( $field[$option] ) ) {
1032
+			$this_option = $field[$option];
1033
+		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) {
1034
+			$this_option = $field['field_options'][$option];
1035 1035
 		} else {
1036 1036
 			$this_option = '';
1037 1037
 		}
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
 	}
1041 1041
 
1042 1042
 	public static function get_option_in_object( $field, $option ) {
1043
-		return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : '';
1043
+		return isset( $field->field_options[$option] ) ? $field->field_options[$option] : '';
1044 1044
 	}
1045 1045
 
1046 1046
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 1 patch
Spacing   +71 added lines, -71 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
 
@@ -830,8 +830,8 @@  discard block
 block discarded – undo
830 830
 		}
831 831
 
832 832
 		global $wp_query;
833
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
834
-			$value = $wp_query->query_vars[ $param ];
833
+		if ( isset( $wp_query->query_vars[$param] ) ) {
834
+			$value = $wp_query->query_vars[$param];
835 835
 		}
836 836
 
837 837
 		return $value;
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
 				'new_file_path' => self::plugin_path() . '/js',
1010 1010
 			)
1011 1011
 		);
1012
-		$new_file  = new FrmCreateFile( $file_atts );
1012
+		$new_file = new FrmCreateFile( $file_atts );
1013 1013
 
1014 1014
 		$files = array(
1015 1015
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1414,8 +1414,8 @@  discard block
 block discarded – undo
1414 1414
 			return $error;
1415 1415
 		}
1416 1416
 
1417
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1418
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1417
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1418
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1419 1419
 			$frm_settings = self::get_settings();
1420 1420
 			$error        = $frm_settings->admin_permission;
1421 1421
 		}
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
 			} else {
1451 1451
 				foreach ( $value as $k => $v ) {
1452 1452
 					if ( ! is_array( $v ) ) {
1453
-						$value[ $k ] = call_user_func( $original_function, $v );
1453
+						$value[$k] = call_user_func( $original_function, $v );
1454 1454
 					}
1455 1455
 				}
1456 1456
 			}
@@ -1475,7 +1475,7 @@  discard block
 block discarded – undo
1475 1475
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
1476 1476
 			} else {
1477 1477
 				if ( $keys == 'keep' ) {
1478
-					$return[ $key ] = $value;
1478
+					$return[$key] = $value;
1479 1479
 				} else {
1480 1480
 					$return[] = $value;
1481 1481
 				}
@@ -1539,11 +1539,11 @@  discard block
 block discarded – undo
1539 1539
 		}
1540 1540
 
1541 1541
 		$ver = $default;
1542
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
1542
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
1543 1543
 			return $ver;
1544 1544
 		}
1545 1545
 
1546
-		$query = $wp_scripts->registered[ $handle ];
1546
+		$query = $wp_scripts->registered[$handle];
1547 1547
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
1548 1548
 			$ver = $query->ver;
1549 1549
 		}
@@ -1720,7 +1720,7 @@  discard block
 block discarded – undo
1720 1720
 
1721 1721
 		foreach ( array( 'name', 'description' ) as $var ) {
1722 1722
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
1723
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1723
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1724 1724
 			unset( $var, $default_val );
1725 1725
 		}
1726 1726
 
@@ -1778,9 +1778,9 @@  discard block
 block discarded – undo
1778 1778
 			}
1779 1779
 		}
1780 1780
 
1781
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
1782
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
1783
-			$new_value = $post_values['item_meta'][ $field->id ];
1781
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
1782
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
1783
+			$new_value = $post_values['item_meta'][$field->id];
1784 1784
 			self::unserialize_or_decode( $new_value );
1785 1785
 		} else {
1786 1786
 			$new_value = $meta_value;
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
 
1802 1802
 		$field_array = array_merge( (array) $field->field_options, $field_array );
1803 1803
 
1804
-		$values['fields'][ $field->id ] = $field_array;
1804
+		$values['fields'][$field->id] = $field_array;
1805 1805
 	}
1806 1806
 
1807 1807
 	/**
@@ -1848,11 +1848,11 @@  discard block
 block discarded – undo
1848 1848
 		}
1849 1849
 
1850 1850
 		foreach ( $form->options as $opt => $value ) {
1851
-			if ( isset( $post_values[ $opt ] ) ) {
1852
-				$values[ $opt ] = $post_values[ $opt ];
1853
-				self::unserialize_or_decode( $values[ $opt ] );
1851
+			if ( isset( $post_values[$opt] ) ) {
1852
+				$values[$opt] = $post_values[$opt];
1853
+				self::unserialize_or_decode( $values[$opt] );
1854 1854
 			} else {
1855
-				$values[ $opt ] = $value;
1855
+				$values[$opt] = $value;
1856 1856
 			}
1857 1857
 		}
1858 1858
 
@@ -1866,8 +1866,8 @@  discard block
 block discarded – undo
1866 1866
 		$form_defaults = FrmFormsHelper::get_default_opts();
1867 1867
 
1868 1868
 		foreach ( $form_defaults as $opt => $default ) {
1869
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
1870
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
1869
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
1870
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
1871 1871
 			}
1872 1872
 
1873 1873
 			unset( $opt, $default );
@@ -1878,8 +1878,8 @@  discard block
 block discarded – undo
1878 1878
 		}
1879 1879
 
1880 1880
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
1881
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
1882
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
1881
+			if ( ! isset( $values[$h . '_html'] ) ) {
1882
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
1883 1883
 			}
1884 1884
 			unset( $h );
1885 1885
 		}
@@ -2031,25 +2031,25 @@  discard block
 block discarded – undo
2031 2031
 		if ( ! is_numeric( $levels ) ) {
2032 2032
 			// Show time in specified unit.
2033 2033
 			$levels = self::get_unit( $levels );
2034
-			if ( isset( $time_strings[ $levels ] ) ) {
2034
+			if ( isset( $time_strings[$levels] ) ) {
2035 2035
 				$diff = array(
2036 2036
 					$levels => self::time_format( $levels, $diff ),
2037 2037
 				);
2038 2038
 				$time_strings = array(
2039
-					$levels => $time_strings[ $levels ],
2039
+					$levels => $time_strings[$levels],
2040 2040
 				);
2041 2041
 			}
2042 2042
 			$levels = 1;
2043 2043
 		}
2044 2044
 
2045 2045
 		foreach ( $time_strings as $k => $v ) {
2046
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2047
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2048
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2046
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2047
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2048
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2049 2049
 				// Account for 0.
2050
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2050
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2051 2051
 			} else {
2052
-				unset( $time_strings[ $k ] );
2052
+				unset( $time_strings[$k] );
2053 2053
 			}
2054 2054
 		}
2055 2055
 
@@ -2068,8 +2068,8 @@  discard block
 block discarded – undo
2068 2068
 			'y' => 'y',
2069 2069
 			'd' => 'days',
2070 2070
 		);
2071
-		if ( isset( $return[ $unit ] ) ) {
2072
-			return $diff[ $return[ $unit ] ];
2071
+		if ( isset( $return[$unit] ) ) {
2072
+			return $diff[$return[$unit]];
2073 2073
 		}
2074 2074
 
2075 2075
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2077,11 +2077,11 @@  discard block
 block discarded – undo
2077 2077
 		$times = array( 'h', 'i', 's' );
2078 2078
 
2079 2079
 		foreach ( $times as $time ) {
2080
-			if ( ! isset( $diff[ $time ] ) ) {
2080
+			if ( ! isset( $diff[$time] ) ) {
2081 2081
 				continue;
2082 2082
 			}
2083 2083
 
2084
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2084
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2085 2085
 		}
2086 2086
 
2087 2087
 		return floor( $total );
@@ -2101,7 +2101,7 @@  discard block
 block discarded – undo
2101 2101
 			'y' => DAY_IN_SECONDS * 365.25,
2102 2102
 		);
2103 2103
 
2104
-		return $convert[ $from ] / $convert[ $to ];
2104
+		return $convert[$from] / $convert[$to];
2105 2105
 	}
2106 2106
 
2107 2107
 	/**
@@ -2109,7 +2109,7 @@  discard block
 block discarded – undo
2109 2109
 	 */
2110 2110
 	private static function get_unit( $unit ) {
2111 2111
 		$units = self::get_time_strings();
2112
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2112
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2113 2113
 			return $unit;
2114 2114
 		}
2115 2115
 
@@ -2220,17 +2220,17 @@  discard block
 block discarded – undo
2220 2220
 
2221 2221
 					case 1:
2222 2222
 						$l2 = $name;
2223
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2223
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2224 2224
 						break;
2225 2225
 
2226 2226
 					case 2:
2227 2227
 						$l3 = $name;
2228
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2228
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2229 2229
 						break;
2230 2230
 
2231 2231
 					case 3:
2232 2232
 						$l4 = $name;
2233
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2233
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2234 2234
 				}
2235 2235
 
2236 2236
 				unset( $this_val, $n );
@@ -2249,8 +2249,8 @@  discard block
 block discarded – undo
2249 2249
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2250 2250
 		if ( $name == '' ) {
2251 2251
 			$vars[] = $val;
2252
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2253
-			$vars[ $l1 ] = $val;
2252
+		} elseif ( ! isset( $vars[$l1] ) ) {
2253
+			$vars[$l1] = $val;
2254 2254
 		}
2255 2255
 	}
2256 2256
 
@@ -2266,7 +2266,7 @@  discard block
 block discarded – undo
2266 2266
 			'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() ) ),
2267 2267
 		);
2268 2268
 
2269
-		if ( ! isset( $tooltips[ $name ] ) ) {
2269
+		if ( ! isset( $tooltips[$name] ) ) {
2270 2270
 			return;
2271 2271
 		}
2272 2272
 
@@ -2276,7 +2276,7 @@  discard block
 block discarded – undo
2276 2276
 			echo ' class="frm_help"';
2277 2277
 		}
2278 2278
 
2279
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2279
+		echo ' title="' . esc_attr( $tooltips[$name] );
2280 2280
 
2281 2281
 		if ( 'open' != $class ) {
2282 2282
 			echo '"';
@@ -2331,13 +2331,13 @@  discard block
 block discarded – undo
2331 2331
 	}
2332 2332
 
2333 2333
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2334
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2334
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2335 2335
 			return;
2336 2336
 		}
2337 2337
 
2338 2338
 		if ( is_array( $val ) ) {
2339 2339
 			foreach ( $val as $k1 => $v1 ) {
2340
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2340
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2341 2341
 				unset( $k1, $v1 );
2342 2342
 			}
2343 2343
 		} else {
@@ -2345,7 +2345,7 @@  discard block
 block discarded – undo
2345 2345
 			$val = stripslashes( $val );
2346 2346
 
2347 2347
 			// Add backslashes before double quotes and forward slashes only
2348
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2348
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2349 2349
 		}
2350 2350
 	}
2351 2351
 
@@ -2404,14 +2404,14 @@  discard block
 block discarded – undo
2404 2404
 				continue;
2405 2405
 			}
2406 2406
 			$key = $input['name'];
2407
-			if ( isset( $formatted[ $key ] ) ) {
2408
-				if ( is_array( $formatted[ $key ] ) ) {
2409
-					$formatted[ $key ][] = $input['value'];
2407
+			if ( isset( $formatted[$key] ) ) {
2408
+				if ( is_array( $formatted[$key] ) ) {
2409
+					$formatted[$key][] = $input['value'];
2410 2410
 				} else {
2411
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
2411
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
2412 2412
 				}
2413 2413
 			} else {
2414
-				$formatted[ $key ] = $input['value'];
2414
+				$formatted[$key] = $input['value'];
2415 2415
 			}
2416 2416
 		}
2417 2417
 
@@ -2981,8 +2981,8 @@  discard block
 block discarded – undo
2981 2981
 		}
2982 2982
 
2983 2983
 		foreach ( $keys as $key ) {
2984
-			if ( isset( $values[ $key ] ) ) {
2985
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
2984
+			if ( isset( $values[$key] ) ) {
2985
+				$values[$key] = self::kses( $values[$key], 'all' );
2986 2986
 			}
2987 2987
 		}
2988 2988
 
Please login to merge, or discard this patch.