Completed
Pull Request — master (#864)
by Stephanie
25s
created
deprecated/FrmEDD_SL_Plugin_Updater.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		$this->beta        = ! empty( $this->api_data['beta'] ) ? true : false;
45 45
 		$this->cache_key   = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) );
46 46
 
47
-		$frm_edd_plugin_data[ $this->slug ] = $this->api_data;
47
+		$frm_edd_plugin_data[$this->slug] = $this->api_data;
48 48
 
49 49
 		/**
50 50
 		 * Fires after the $frm_edd_plugin_data is setup.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			$_transient_data = new stdClass();
94 94
 		}
95 95
 
96
-		if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
96
+		if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) {
97 97
 			return $_transient_data;
98 98
 		}
99 99
 
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 					$version_info->plugin = $this->name;
121 121
 				}
122 122
 
123
-				$_transient_data->response[ $this->name ] = $version_info;
123
+				$_transient_data->response[$this->name] = $version_info;
124 124
 
125 125
 			}
126 126
 
127 127
 			$_transient_data->last_checked           = time();
128
-			$_transient_data->checked[ $this->name ] = $this->version;
128
+			$_transient_data->checked[$this->name] = $this->version;
129 129
 
130 130
 		}
131 131
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
190 190
 			$new_sections = array();
191 191
 			foreach ( $_data->sections as $key => $value ) {
192
-				$new_sections[ $key ] = $value;
192
+				$new_sections[$key] = $value;
193 193
 			}
194 194
 
195 195
 			$_data->sections = $new_sections;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
200 200
 			$new_banners = array();
201 201
 			foreach ( $_data->banners as $key => $value ) {
202
-				$new_banners[ $key ] = $value;
202
+				$new_banners[$key] = $value;
203 203
 			}
204 204
 
205 205
 			$_data->banners = $new_banners;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		}
317 317
 
318 318
 		$slug         = sanitize_text_field( $_REQUEST['slug'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
319
-		$data         = $frm_edd_plugin_data[ $slug ];
319
+		$data         = $frm_edd_plugin_data[$slug];
320 320
 		$beta         = ! empty( $data['beta'] ) ? true : false;
321 321
 		$cache_key    = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
322 322
 		$version_info = $this->get_cached_version_info( $cache_key );
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -303,11 +303,13 @@
 block discarded – undo
303 303
 
304 304
 		global $frm_edd_plugin_data;
305 305
 
306
-		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
306
+		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) {
307
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
307 308
 			return;
308 309
 		}
309 310
 
310
-		if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
311
+		if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) {
312
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
311 313
 			return;
312 314
 		}
313 315
 
Please login to merge, or discard this patch.
classes/views/solutions/_import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 				$info['url'] = $xml;
12 12
 			}
13 13
 
14
-			$disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : '';
14
+			$disabled = isset( $imported[$info['form']] ) ? ' disabled' : '';
15 15
 			$url   = isset( $info['url'] ) ? $info['url'] : '';
16 16
 			$value = $importing === 'form' ? $info['form'] : $info['key'];
17 17
 			if ( ! isset( $info['img'] ) ) {
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 				continue;
22 22
 			}
23 23
 
24
-			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) );
24
+			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) );
25 25
 			?>
26 26
 			<div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>">
27 27
 				<?php if ( $importing === 'form' ) { ?>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 					<?php } ?>
42 42
 					/>
43 43
 					<div class="frm_image_option_container frm_label_with_image">
44
-						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) );  // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
44
+						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
45 45
 						<span class="frm_text_label_for_image">
46 46
 							<?php
47 47
 							if ( ! empty( $disabled ) ) {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 							}
55 55
 
56 56
 							if ( $importing === 'form' && $disabled ) {
57
-								echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
57
+								echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
58 58
 							} else {
59 59
 								echo esc_html( $info['name'] );
60 60
 							}
Please login to merge, or discard this patch.
classes/helpers/FrmStylesHelper.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 				'-' => 'down',
195 195
 				'+' => 'up',
196 196
 			);
197
-			$class = 'frm_arrow' . $arrow[ $icon ];
197
+			$class = 'frm_arrow' . $arrow[$icon];
198 198
 		} else {
199 199
 			//frm_minus1_icon
200 200
 			$key   = str_replace( 'p', '', $key );
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				'-' => 'minus',
203 203
 				'+' => 'plus',
204 204
 			);
205
-			$class = 'frm_' . $plus[ $icon ];
205
+			$class = 'frm_' . $plus[$icon];
206 206
 		}
207 207
 
208 208
 		if ( $key ) {
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 		?>
223 223
 		<div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select">
224 224
 			<button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button">
225
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?>
226
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?>
225
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?>
226
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?>
227 227
 				<b class="caret"></b>
228 228
 			</button>
229 229
 			<ul class="multiselect-container frm-dropdown-menu">
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 					<li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>>
232 232
 						<a href="javascript:void(0);">
233 233
 							<label>
234
-								<input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?>/>
234
+								<input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?>/>
235 235
 								<span>
236 236
 									<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); ?>
237 237
 									<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '-', $type ) ); ?>
@@ -313,15 +313,15 @@  discard block
 block discarded – undo
313 313
 		$vars   = array_diff( $vars, $remove );
314 314
 
315 315
 		foreach ( $vars as $var ) {
316
-			if ( ! isset( $settings[ $var ] ) ) {
316
+			if ( ! isset( $settings[$var] ) ) {
317 317
 				continue;
318 318
 			}
319
-			if ( ! isset( $defaults[ $var ] ) ) {
320
-				$defaults[ $var ] = '';
319
+			if ( ! isset( $defaults[$var] ) ) {
320
+				$defaults[$var] = '';
321 321
 			}
322
-			$show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] );
322
+			$show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] );
323 323
 			if ( $show ) {
324
-				echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
324
+				echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
325 325
 			}
326 326
 		}
327 327
 	}
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 
372 372
 		$checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' );
373 373
 		foreach ( $checkbox_opts as $opt ) {
374
-			if ( ! isset( $settings[ $opt ] ) ) {
375
-				$settings[ $opt ] = 0;
374
+			if ( ! isset( $settings[$opt] ) ) {
375
+				$settings[$opt] = 0;
376 376
 			}
377 377
 		}
378 378
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 				$css = '';
401 401
 			}
402 402
 			foreach ( $opts as $opt ) {
403
-				self::get_color_output( $css, $settings[ $opt ] );
403
+				self::get_color_output( $css, $settings[$opt] );
404 404
 			}
405 405
 		}
406 406
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -336,7 +336,8 @@
 block discarded – undo
336 336
 		if ( self::previewing_style() ) {
337 337
 
338 338
 			$frm_style = new FrmStyle();
339
-			if ( isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
339
+			if ( isset( $_POST['frm_style_setting'] ) ) {
340
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
340 341
 
341 342
 				// Sanitizing is done later.
342 343
 				$posted = wp_unslash( $_POST['frm_style_setting'] ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/html-content.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 				'title'     => esc_attr__( 'Toggle Options', 'formidable' ),
17 17
 			)
18 18
 		);
19
-		$e_args  = array(
19
+		$e_args = array(
20 20
 			'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']',
21 21
 			'textarea_rows' => 8,
22 22
 		);
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldCaptcha.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
 
152 152
 		if ( is_wp_error( $resp ) ) {
153 153
 			$error_string                     = $resp->get_error_message();
154
-			$errors[ 'field' . $args['id'] ]  = __( 'There was a problem verifying your recaptcha', 'formidable' );
155
-			$errors[ 'field' . $args['id'] ] .= ' ' . $error_string;
154
+			$errors['field' . $args['id']]  = __( 'There was a problem verifying your recaptcha', 'formidable' );
155
+			$errors['field' . $args['id']] .= ' ' . $error_string;
156 156
 			return $errors;
157 157
 		}
158 158
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		if ( isset( $response['success'] ) && ! $response['success'] ) {
175 175
 			// What happens when the CAPTCHA was entered incorrectly
176 176
 			$invalid_message                 = FrmField::get_option( $this->field, 'invalid' );
177
-			$errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message );
177
+			$errors['field' . $args['id']] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message );
178 178
 		}
179 179
 
180 180
 		return $errors;
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
 			$frm_vars['captcha_scores'] = array();
191 191
 		}
192 192
 		$form_id = is_object( $this->field ) ? $this->field->form_id : $this->field['form_id'];
193
-		if ( ! isset( $frm_vars['captcha_scores'][ $form_id ] ) ) {
194
-			$frm_vars['captcha_scores'][ $form_id ] = $score;
193
+		if ( ! isset( $frm_vars['captcha_scores'][$form_id] ) ) {
194
+			$frm_vars['captcha_scores'][$form_id] = $score;
195 195
 		}
196 196
 	}
197 197
 
Please login to merge, or discard this patch.
classes/models/FrmEntry.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 			$metas       = FrmEntryMeta::get_entry_meta_info( $entry_exist );
81 81
 			$field_metas = array();
82 82
 			foreach ( $metas as $meta ) {
83
-				$field_metas[ $meta->field_id ] = $meta->meta_value;
83
+				$field_metas[$meta->field_id] = $meta->meta_value;
84 84
 			}
85 85
 
86 86
 			$filtered_vals = array_filter( $values['item_meta'] );
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
 		$reduced = array();
137 137
 		foreach ( $filter_vals as $field_id => $value ) {
138 138
 			$field                = FrmFieldFactory::get_field_object( $field_id );
139
-			$reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
140
-			$reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] );
141
-			if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) {
142
-				unset( $reduced[ $field_id ] );
139
+			$reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
140
+			$reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] );
141
+			if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) {
142
+				unset( $reduced[$field_id] );
143 143
 			}
144 144
 		}
145 145
 		return $reduced;
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 		$query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it
333 333
                   LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE ";
334 334
 
335
-		$query      .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
335
+		$query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
336 336
 		$query_args = array( $id );
337 337
 		$query      = $wpdb->prepare( $query, $query_args ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
338 338
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	private static function prepare_entries( &$entries ) {
378 378
 		foreach ( $entries as $k => $entry ) {
379 379
 			self::prepare_entry( $entry );
380
-			$entries[ $k ] = $entry;
380
+			$entries[$k] = $entry;
381 381
 		}
382 382
 	}
383 383
 
@@ -402,20 +402,20 @@  discard block
 block discarded – undo
402 402
 		foreach ( $metas as $meta_val ) {
403 403
 			if ( $meta_val->item_id == $entry->id ) {
404 404
 				FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
405
-				$entry->metas[ $meta_val->field_id ] = $meta_val->meta_value;
405
+				$entry->metas[$meta_val->field_id] = $meta_val->meta_value;
406 406
 				if ( $include_key ) {
407
-					$entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ];
407
+					$entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id];
408 408
 				}
409 409
 				continue;
410 410
 			}
411 411
 
412 412
 			// include sub entries in an array
413
-			if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) {
414
-				$entry->metas[ $meta_val->field_id ] = array();
413
+			if ( ! isset( $entry->metas[$meta_val->field_id] ) ) {
414
+				$entry->metas[$meta_val->field_id] = array();
415 415
 			}
416 416
 
417 417
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
418
-			$entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value;
418
+			$entry->metas[$meta_val->field_id][] = $meta_val->meta_value;
419 419
 
420 420
 			unset( $meta_val );
421 421
 		}
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 
463 463
 			if ( $inc_form ) {
464 464
 				$fields = 'it.*, fr.name as form_name,fr.form_key as form_key';
465
-				$table  .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
465
+				$table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
466 466
 			}
467 467
 
468 468
 			if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) {
@@ -506,16 +506,16 @@  discard block
 block discarded – undo
506 506
 		}
507 507
 
508 508
 		foreach ( $metas as $m_key => $meta_val ) {
509
-			if ( ! isset( $entries[ $meta_val->item_id ] ) ) {
509
+			if ( ! isset( $entries[$meta_val->item_id] ) ) {
510 510
 				continue;
511 511
 			}
512 512
 
513
-			if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) {
514
-				$entries[ $meta_val->item_id ]->metas = array();
513
+			if ( ! isset( $entries[$meta_val->item_id]->metas ) ) {
514
+				$entries[$meta_val->item_id]->metas = array();
515 515
 			}
516 516
 
517 517
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
518
-			$entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value;
518
+			$entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value;
519 519
 			unset( $m_key, $meta_val );
520 520
 		}
521 521
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 	}
694 694
 
695 695
 	private static function get_entry_value( $values, $name, $default ) {
696
-		return isset( $values[ $name ] ) ? $values[ $name ] : $default;
696
+		return isset( $values[$name] ) ? $values[$name] : $default;
697 697
 	}
698 698
 
699 699
 	/**
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 	private static function maybe_add_captcha_meta( $form_id, $entry_id ) {
875 875
 		global $frm_vars;
876 876
 		if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) {
877
-			$captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] );
877
+			$captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] );
878 878
 			FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) );
879 879
 		}
880 880
 	}
Please login to merge, or discard this patch.
classes/views/frm-forms/landing-page-preview-option.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 $data_keys = array_keys( $data );
7 7
 $params    = array();
8 8
 foreach ( $data_keys as $key ) {
9
-	$params[ 'data-' . $key ] = $data[ $key ];
9
+	$params['data-' . $key] = $data[$key];
10 10
 }
11 11
 $params['class'] = 'frm_show_upgrade frm_noallow';
12 12
 $params['href']  = '#';
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			'class'        => '',
29 29
 			'inc_children' => 'exclude',
30 30
 		);
31
-		$args     = wp_parse_args( $args, $defaults );
31
+		$args = wp_parse_args( $args, $defaults );
32 32
 
33 33
 		if ( ! $args['field_id'] ) {
34 34
 			$args['field_id'] = $field_name;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public static function add_html_attr( $class, $param, &$add_html ) {
72 72
 		if ( ! empty( $class ) ) {
73
-			$add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
73
+			$add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
74 74
 		}
75 75
 	}
76 76
 
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
 			'description' => '',
277 277
 		);
278 278
 		foreach ( $defaults as $var => $default ) {
279
-			if ( ! isset( $values[ $var ] ) ) {
280
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
279
+			if ( ! isset( $values[$var] ) ) {
280
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
281 281
 			}
282 282
 		}
283 283
 
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
 			'parent_form_id' => 0,
293 293
 		);
294 294
 		foreach ( $defaults as $var => $default ) {
295
-			if ( ! isset( $values[ $var ] ) ) {
296
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
295
+			if ( ! isset( $values[$var] ) ) {
296
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
297 297
 			}
298 298
 		}
299 299
 		unset( $defaults );
@@ -330,16 +330,16 @@  discard block
 block discarded – undo
330 330
 		$defaults = self::get_default_opts();
331 331
 		foreach ( $defaults as $var => $default ) {
332 332
 			if ( is_array( $default ) ) {
333
-				if ( ! isset( $values[ $var ] ) ) {
334
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
333
+				if ( ! isset( $values[$var] ) ) {
334
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
335 335
 				}
336 336
 
337 337
 				foreach ( $default as $k => $v ) {
338
-					$values[ $var ][ $k ] = ( $post_values && isset( $post_values[ $var ][ $k ] ) ) ? $post_values[ $var ][ $k ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ) ? $record->options[ $var ][ $k ] : $v );
338
+					$values[$var][$k] = ( $post_values && isset( $post_values[$var][$k] ) ) ? $post_values[$var][$k] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ) ? $record->options[$var][$k] : $v );
339 339
 
340 340
 					if ( is_array( $v ) ) {
341 341
 						foreach ( $v as $k1 => $v1 ) {
342
-							$values[ $var ][ $k ][ $k1 ] = ( $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ) ? $post_values[ $var ][ $k ][ $k1 ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 );
342
+							$values[$var][$k][$k1] = ( $post_values && isset( $post_values[$var][$k][$k1] ) ) ? $post_values[$var][$k][$k1] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ) ? $record->options[$var][$k][$k1] : $v1 );
343 343
 							unset( $k1, $v1 );
344 344
 						}
345 345
 					}
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 					unset( $k, $v );
348 348
 				}
349 349
 			} else {
350
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
350
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
351 351
 			}
352 352
 
353 353
 			unset( $var, $default );
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 	public static function fill_form_options( &$options, $values ) {
388 388
 		$defaults = self::get_default_opts();
389 389
 		foreach ( $defaults as $var => $default ) {
390
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
390
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
391 391
 			unset( $var, $default );
392 392
 		}
393 393
 	}
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 	public static function insert_opt_html( $args ) {
550 550
 		$class  = isset( $args['class'] ) ? $args['class'] : '';
551 551
 		$fields = FrmField::all_field_selection();
552
-		$field  = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array();
552
+		$field  = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array();
553 553
 
554 554
 		self::prepare_field_type( $field );
555 555
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 			FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) );
706 706
 		}
707 707
 
708
-		$add_order    += 2;
708
+		$add_order += 2;
709 709
 		$open         = false;
710 710
 		$reset_fields = true;
711 711
 	}
@@ -1108,10 +1108,10 @@  discard block
 block discarded – undo
1108 1108
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1109 1109
 			}
1110 1110
 
1111
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
1112
-			if ( $length == 'icon' && isset( $link_details[ $length ] ) ) {
1111
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
1112
+			if ( $length == 'icon' && isset( $link_details[$length] ) ) {
1113 1113
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1114
-				$link  .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1114
+				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1115 1115
 			}
1116 1116
 
1117 1117
 			$link .= '>' . $label . '</a>';
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
 			$status = 'publish';
1251 1251
 		}
1252 1252
 
1253
-		$name = $nice_names[ $status ];
1253
+		$name = $nice_names[$status];
1254 1254
 
1255 1255
 		return $name;
1256 1256
 	}
@@ -1283,17 +1283,17 @@  discard block
 block discarded – undo
1283 1283
 			''                    => array( 'align_right' ),
1284 1284
 		);
1285 1285
 
1286
-		$icons[ __( 'My Templates', 'formidable' ) ] = array( 'user', 'var(--orange)' );
1286
+		$icons[__( 'My Templates', 'formidable' )] = array( 'user', 'var(--orange)' );
1287 1287
 
1288 1288
 		$icon = $icons[''];
1289 1289
 
1290 1290
 		if ( count( $categories ) === 1 ) {
1291 1291
 			$category = reset( $categories );
1292
-			$icon     = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon;
1292
+			$icon     = isset( $icons[$category] ) ? $icons[$category] : $icon;
1293 1293
 		} elseif ( ! empty( $categories ) ) {
1294 1294
 			foreach ( $icons as $cat => $icon ) {
1295 1295
 				if ( ! in_array( $cat, $categories ) ) {
1296
-					unset( $icons[ $cat ] );
1296
+					unset( $icons[$cat] );
1297 1297
 				}
1298 1298
 			}
1299 1299
 			$icon = reset( $icons );
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 
1423 1423
 		foreach ( $item['categories'] as $k => $category ) {
1424 1424
 			if ( in_array( $category, $plans, true ) ) {
1425
-				unset( $item['categories'][ $k ] );
1425
+				unset( $item['categories'][$k] );
1426 1426
 
1427 1427
 				if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) {
1428 1428
 					// Show the current package name.
@@ -1650,9 +1650,9 @@  discard block
 block discarded – undo
1650 1650
 		}
1651 1651
 
1652 1652
 		foreach ( $shortcodes[0] as $key => $shortcode ) {
1653
-			$options = trim( $shortcodes[3][ $key ] );
1653
+			$options = trim( $shortcodes[3][$key] );
1654 1654
 
1655
-			if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) {
1655
+			if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) {
1656 1656
 				// Skip if shortcodes.
1657 1657
 				continue;
1658 1658
 			}
@@ -1662,7 +1662,7 @@  discard block
 block discarded – undo
1662 1662
 				continue;
1663 1663
 			}
1664 1664
 
1665
-			$new_shortcode = '[' . $shortcodes[2][ $key ];
1665
+			$new_shortcode = '[' . $shortcodes[2][$key];
1666 1666
 			if ( $options ) {
1667 1667
 				$new_shortcode .= ' ' . $options;
1668 1668
 			}
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/combo-field/combo-field.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			$sub_field_class   = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}";
42 42
 			$sub_field_desc    = FrmField::get_option( $field, $name . '_desc' );
43 43
 
44
-			if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) {
44
+			if ( isset( $errors['field' . $field_id . '-' . $name] ) ) {
45 45
 				$sub_field_class .= ' frm_blank_field';
46 46
 			}
47 47
 			?>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 						<input
62 62
 							type="<?php echo esc_attr( $sub_field['type'] ); ?>"
63 63
 							id="<?php echo esc_attr( $html_id . '_' . $name ); ?>"
64
-							value="<?php echo esc_attr( isset( $field_value[ $name ] ) ? $field_value[ $name ] : '' ); ?>"
64
+							value="<?php echo esc_attr( isset( $field_value[$name] ) ? $field_value[$name] : '' ); ?>"
65 65
 							<?php
66 66
 							if ( empty( $args['remove_names'] ) ) {
67 67
 								echo 'name="' . esc_attr( $field_name ) . '[' . esc_attr( $name ) . ']" ';
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 				}
79 79
 
80 80
 				// Don't show individual field errors when there is a combo field error.
81
-				if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) {
81
+				if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) {
82 82
 					?>
83
-					<div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div>
83
+					<div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div>
84 84
 				<?php } ?>
85 85
 			</div>
86 86
 		<?php } ?>
Please login to merge, or discard this patch.