Completed
Pull Request — master (#458)
by Stephanie
46s
created
classes/controllers/FrmAddonsController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		} else {
75 75
 			foreach ( $addons as $k => $addon ) {
76 76
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
77
-					unset( $addons[ $k ] );
77
+					unset( $addons[$k] );
78 78
 				}
79 79
 			}
80 80
 		}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 		foreach ( $list as $k => $info ) {
172 172
 			$info['slug'] = $k;
173
-			$list[ $k ]   = array_merge( $defaults, $info );
173
+			$list[$k]   = array_merge( $defaults, $info );
174 174
 		}
175 175
 		return $list;
176 176
 	}
@@ -349,16 +349,16 @@  discard block
 block discarded – undo
349 349
 				continue;
350 350
 			}
351 351
 
352
-			$wp_plugin  = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
352
+			$wp_plugin  = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array();
353 353
 			$wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
354 354
 
355 355
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
356 356
 				$slug                           = explode( '/', $folder );
357 357
 				$plugin->slug                   = $slug[0];
358
-				$transient->response[ $folder ] = $plugin;
358
+				$transient->response[$folder] = $plugin;
359 359
 			}
360 360
 
361
-			$transient->checked[ $folder ] = $wp_version;
361
+			$transient->checked[$folder] = $wp_version;
362 362
 
363 363
 		}
364 364
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 
382 382
 		$all_plugins = get_plugins();
383 383
 
384
-		return isset( $all_plugins[ $plugin ] );
384
+		return isset( $all_plugins[$plugin] );
385 385
 	}
386 386
 
387 387
 	/**
@@ -420,13 +420,13 @@  discard block
 block discarded – undo
420 420
 			}
421 421
 
422 422
 			$download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0;
423
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
423
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
424 424
 				// if this addon is using its own license, get the update url
425 425
 				$addon_info = $api->get_api_info();
426 426
 
427
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
427
+				$version_info[$download_id] = $addon_info[$download_id];
428 428
 				if ( isset( $addon_info['error'] ) ) {
429
-					$version_info[ $download_id ]['error'] = array(
429
+					$version_info[$download_id]['error'] = array(
430 430
 						'message' => $addon_info['error']['message'],
431 431
 						'code'    => $addon_info['error']['code'],
432 432
 					);
@@ -520,8 +520,8 @@  discard block
 block discarded – undo
520 520
 					return $addon;
521 521
 				}
522 522
 			}
523
-		} elseif ( isset( $addons[ $download_id ] ) ) {
524
-			$plugin = $addons[ $download_id ];
523
+		} elseif ( isset( $addons[$download_id] ) ) {
524
+			$plugin = $addons[$download_id];
525 525
 		}
526 526
 
527 527
 		return $plugin;
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 			self::prepare_addon_link( $addon['link'] );
576 576
 
577 577
 			self::set_addon_status( $addon );
578
-			$addons[ $id ] = $addon;
578
+			$addons[$id] = $addon;
579 579
 		}
580 580
 	}
581 581
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 			'utm_medium'   => 'addons',
594 594
 			'utm_campaign' => 'liteplugin',
595 595
 		);
596
-		$link       = add_query_arg( $query_args, $link );
596
+		$link = add_query_arg( $query_args, $link );
597 597
 	}
598 598
 
599 599
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesListHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 			$s_query['it.form_id'] = $form_id;
26 26
 			$join_form_in_query    = false;
27 27
 		} else {
28
-			$s_query[]          = array(
28
+			$s_query[] = array(
29 29
 				'or'               => 1,
30 30
 				'parent_form_id'   => null,
31 31
 				'parent_form_id <' => 1,
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 		if ( strpos( $orderby, 'meta' ) !== false ) {
58 58
 			$order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
59
-			$orderby          .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : '';
59
+			$orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : '';
60 60
 		}
61 61
 
62 62
 		$order = self::get_param(
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 		$r = "<tr id='item-action-{$item->id}'$style>";
191 191
 
192
-		list( $columns, $hidden, , $primary ) = $this->get_column_info();
192
+		list( $columns, $hidden,, $primary ) = $this->get_column_info();
193 193
 		$action_col                           = false;
194 194
 		$action_columns                       = $this->get_action_columns();
195 195
 
Please login to merge, or discard this patch.
classes/models/FrmFormTemplateApi.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 class FrmFormTemplateApi extends FrmFormApi {
7 7
 
8
-	protected static $code_option_name  = 'frm_free_license_code';
8
+	protected static $code_option_name = 'frm_free_license_code';
9 9
 
10 10
 	private static $base_api_url = 'https://formidableforms.com/wp-json/form-templates/v1/';
11 11
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
 		$templates    = $this->get_api_info();
78 78
 		$contact_form = 20872734;
79
-		return isset( $templates[ $contact_form ] ) && ! empty( $templates[ $contact_form ]['url'] );
79
+		return isset( $templates[$contact_form] ) && ! empty( $templates[$contact_form]['url'] );
80 80
 	}
81 81
 
82 82
 	/**
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
 					continue;
138 138
 				}
139 139
 
140
-				$data['urlByKey'][ $template['key'] ] = $template['url'];
140
+				$data['urlByKey'][$template['key']] = $template['url'];
141 141
 			}
142 142
 
143
-			if ( ! isset( $data['urlByKey'][ $key ] ) ) {
143
+			if ( ! isset( $data['urlByKey'][$key] ) ) {
144 144
 				$error = new WP_Error( 400, 'We were unable to retrieve the template' );
145 145
 				wp_send_json_error( $error );
146 146
 			}
147 147
 
148
-			$data['url'] = $data['urlByKey'][ $key ];
148
+			$data['url'] = $data['urlByKey'][$key];
149 149
 		}
150 150
 
151 151
 		wp_send_json_success( $data );
Please login to merge, or discard this patch.
classes/models/FrmFormAction.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -5,15 +5,15 @@  discard block
 block discarded – undo
5 5
 
6 6
 class FrmFormAction {
7 7
 
8
-	public $id_base;         // Root id for all actions of this type.
9
-	public $name;            // Name for this action type.
8
+	public $id_base; // Root id for all actions of this type.
9
+	public $name; // Name for this action type.
10 10
 	public $option_name;
11
-	public $action_options;  // Option array passed to wp_register_sidebar_widget()
11
+	public $action_options; // Option array passed to wp_register_sidebar_widget()
12 12
 	public $control_options; // Option array passed to wp_register_widget_control()
13 13
 
14
-	public $form_id;         // The ID of the form to evaluate
15
-	public $number = false;  // Unique ID number of the current instance.
16
-	public $id = '';         // Unique ID string of the current instance (id_base-number)
14
+	public $form_id; // The ID of the form to evaluate
15
+	public $number = false; // Unique ID number of the current instance.
16
+	public $id = ''; // Unique ID string of the current instance (id_base-number)
17 17
 	public $updated = false; // Set true when we update the data after a POST submit - makes sure we don't do it twice.
18 18
 
19 19
 	// Member functions that you must over-ride.
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 		$groups = FrmFormActionsController::form_action_groups();
142 142
 		$group  = 'misc';
143 143
 
144
-		if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) {
144
+		if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) {
145 145
 			$group = $action_options['group'];
146
-		} elseif ( isset( $groups[ $this->id_base ] ) ) {
146
+		} elseif ( isset( $groups[$this->id_base] ) ) {
147 147
 			$group = $this->id_base;
148 148
 		} else {
149 149
 			foreach ( $groups as $name => $check_group ) {
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 			}
155 155
 		}
156 156
 
157
-		$groups[ $group ]['id'] = $group;
158
-		return $groups[ $group ];
157
+		$groups[$group]['id'] = $group;
158
+		return $groups[$group];
159 159
 	}
160 160
 
161 161
 	/**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 * @return integer $post_id
258 258
 	 */
259 259
 	public function maybe_create_action( $action, $forms ) {
260
-		if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] == 'updated' ) {
260
+		if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] == 'updated' ) {
261 261
 			// Update action only
262 262
 			$action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] );
263 263
 			$post_id                = $this->save_settings( $action );
@@ -277,18 +277,18 @@  discard block
 block discarded – undo
277 277
 		$switch             = $this->get_global_switch_fields();
278 278
 
279 279
 		foreach ( (array) $action->post_content as $key => $val ) {
280
-			if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) {
281
-				$action->post_content[ $key ] = $frm_duplicate_ids[ $val ];
280
+			if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) {
281
+				$action->post_content[$key] = $frm_duplicate_ids[$val];
282 282
 			} elseif ( ! is_array( $val ) ) {
283
-				$action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val );
284
-			} elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) {
283
+				$action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val );
284
+			} elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) {
285 285
 				// loop through each value if empty
286
-				if ( empty( $switch[ $key ] ) ) {
287
-					$switch[ $key ] = array_keys( $val );
286
+				if ( empty( $switch[$key] ) ) {
287
+					$switch[$key] = array_keys( $val );
288 288
 				}
289 289
 
290
-				foreach ( $switch[ $key ] as $subkey ) {
291
-					$action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val );
290
+				foreach ( $switch[$key] as $subkey ) {
291
+					$action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val );
292 292
 				}
293 293
 			}
294 294
 
@@ -306,20 +306,20 @@  discard block
 block discarded – undo
306 306
 			foreach ( $subkey as $subkey2 ) {
307 307
 				foreach ( (array) $val as $ck => $cv ) {
308 308
 					if ( is_array( $cv ) ) {
309
-						$action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv );
310
-					} elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) {
311
-						$action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ];
309
+						$action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv );
310
+					} elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) {
311
+						$action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]];
312 312
 					}
313 313
 				}
314 314
 			}
315 315
 		} else {
316 316
 			foreach ( (array) $val as $ck => $cv ) {
317 317
 				if ( is_array( $cv ) ) {
318
-					$action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv );
319
-				} elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) {
320
-					$action[ $ck ] = $frm_duplicate_ids[ $cv ];
318
+					$action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv );
319
+				} elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) {
320
+					$action[$ck] = $frm_duplicate_ids[$cv];
321 321
 				} elseif ( $ck == $subkey ) {
322
-					$action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] );
322
+					$action[$ck] = $this->maybe_switch_field_ids( $action[$ck] );
323 323
 				}
324 324
 			}
325 325
 		}
@@ -342,10 +342,10 @@  discard block
 block discarded – undo
342 342
 			return;
343 343
 		}
344 344
 
345
-		if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) {
345
+		if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) {
346 346
 			// Sanitizing removes scripts and <email> type of values.
347 347
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
348
-			$settings = wp_unslash( $_POST[ $this->option_name ] );
348
+			$settings = wp_unslash( $_POST[$this->option_name] );
349 349
 		} else {
350 350
 			return;
351 351
 		}
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 		foreach ( $settings as $number => $new_instance ) {
356 356
 			$this->_set( $number );
357 357
 
358
-			$old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array();
358
+			$old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array();
359 359
 
360 360
 			if ( ! isset( $new_instance['post_status'] ) ) {
361 361
 				$new_instance['post_status'] = 'draft';
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 			$instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $new_instance['post_content'], $instance, $new_instance, $old_instance, $this );
396 396
 
397 397
 			if ( false !== $instance ) {
398
-				$all_instances[ $number ] = $instance;
398
+				$all_instances[$number] = $instance;
399 399
 			}
400 400
 
401 401
 			$action_ids[] = $this->save_settings( $instance );
@@ -471,12 +471,12 @@  discard block
 block discarded – undo
471 471
 			// some plugins/themes are formatting the post_excerpt
472 472
 			$action->post_excerpt = sanitize_title( $action->post_excerpt );
473 473
 
474
-			if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) {
474
+			if ( ! isset( $action_controls[$action->post_excerpt] ) ) {
475 475
 				continue;
476 476
 			}
477 477
 
478
-			$action                  = $action_controls[ $action->post_excerpt ]->prepare_action( $action );
479
-			$settings[ $action->ID ] = $action;
478
+			$action                  = $action_controls[$action->post_excerpt]->prepare_action( $action );
479
+			$settings[$action->ID] = $action;
480 480
 
481 481
 			if ( count( $settings ) >= $limit ) {
482 482
 				break;
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 			'limit'       => 99,
507 507
 			'post_status' => $default_status,
508 508
 		);
509
-		$args     = wp_parse_args( $args, $defaults );
509
+		$args = wp_parse_args( $args, $defaults );
510 510
 	}
511 511
 
512 512
 	/**
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 
568 568
 			$action = $this->prepare_action( $action );
569 569
 
570
-			$settings[ $action->ID ] = $action;
570
+			$settings[$action->ID] = $action;
571 571
 		}
572 572
 
573 573
 		if ( 1 === $limit ) {
@@ -604,10 +604,10 @@  discard block
 block discarded – undo
604 604
 
605 605
 		foreach ( $default_values as $k => $vals ) {
606 606
 			if ( is_array( $vals ) && ! empty( $vals ) ) {
607
-				if ( 'event' == $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) {
607
+				if ( 'event' == $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) {
608 608
 					continue;
609 609
 				}
610
-				$action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals );
610
+				$action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals );
611 611
 			}
612 612
 		}
613 613
 
@@ -682,14 +682,14 @@  discard block
 block discarded – undo
682 682
 	 * Migrate settings from form->options into new action.
683 683
 	 */
684 684
 	public function migrate_to_2( $form, $update = 'update' ) {
685
-		$action        = $this->prepare_new( $form->id );
685
+		$action = $this->prepare_new( $form->id );
686 686
 		FrmAppHelper::unserialize_or_decode( $form->options );
687 687
 
688 688
 		// fill with existing options
689 689
 		foreach ( $action->post_content as $name => $val ) {
690
-			if ( isset( $form->options[ $name ] ) ) {
691
-				$action->post_content[ $name ] = $form->options[ $name ];
692
-				unset( $form->options[ $name ] );
690
+			if ( isset( $form->options[$name] ) ) {
691
+				$action->post_content[$name] = $form->options[$name];
692
+				unset( $form->options[$name] );
693 693
 			}
694 694
 		}
695 695
 
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
 				$stop = $stop ? false : true;
756 756
 			}
757 757
 
758
-			$met[ $stop ] = $stop;
758
+			$met[$stop] = $stop;
759 759
 		}
760 760
 
761 761
 		if ( $notification['conditions']['any_all'] == 'all' && ! empty( $met ) && isset( $met[0] ) && isset( $met[1] ) ) {
@@ -806,8 +806,8 @@  discard block
 block discarded – undo
806 806
 	private static function get_value_from_entry( $entry, $field_id ) {
807 807
 		$observed_value = '';
808 808
 
809
-		if ( isset( $entry->metas[ $field_id ] ) ) {
810
-			$observed_value = $entry->metas[ $field_id ];
809
+		if ( isset( $entry->metas[$field_id] ) ) {
810
+			$observed_value = $entry->metas[$field_id];
811 811
 		} elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) {
812 812
 			$field          = FrmField::getOne( $field_id );
813 813
 			$observed_value = FrmProEntryMetaHelper::get_post_or_meta_value(
Please login to merge, or discard this patch.
classes/helpers/FrmFieldsHelper.php 1 patch
Spacing   +37 added lines, -37 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;
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 		}
415 415
 
416 416
 		$base_name = 'default_value_' . $field['id'];
417
-		$html_id    = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
417
+		$html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
418 418
 
419 419
 		$default_type = self::get_default_value_type( $field );
420 420
 
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 				continue;
713 713
 			}
714 714
 
715
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
715
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
716 716
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
717 717
 
718 718
 			$atts['entry'] = $entry;
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
 
722 722
 			if ( $replace_with !== null ) {
723 723
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
724
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
724
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
725 725
 			}
726 726
 
727 727
 			unset( $atts, $replace_with );
@@ -764,8 +764,8 @@  discard block
 block discarded – undo
764 764
 
765 765
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' );
766 766
 
767
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
768
-			$replace_with = $shortcode_values[ $atts['tag'] ];
767
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
768
+			$replace_with = $shortcode_values[$atts['tag']];
769 769
 		} elseif ( in_array( $atts['tag'], $dynamic_default ) ) {
770 770
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
771 771
 		} elseif ( $clean_tag == 'user_agent' ) {
@@ -976,8 +976,8 @@  discard block
 block discarded – undo
976 976
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
977 977
 		} elseif ( in_array( $type, $multiple_input ) ) {
978 978
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
979
-		} elseif ( isset( $field_selection[ $type ] ) ) {
980
-			$field_types[ $type ] = $field_selection[ $type ];
979
+		} elseif ( isset( $field_selection[$type] ) ) {
980
+			$field_types[$type] = $field_selection[$type];
981 981
 		}
982 982
 
983 983
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type' ) );
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 
1011 1011
 	private static function field_types_for_input( $inputs, $fields, &$field_types ) {
1012 1012
 		foreach ( $inputs as $input ) {
1013
-			$field_types[ $input ] = $fields[ $input ];
1013
+			$field_types[$input] = $fields[$input];
1014 1014
 			unset( $input );
1015 1015
 		}
1016 1016
 	}
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 			'parent'  => false,
1043 1043
 			'pointer' => false,
1044 1044
 		);
1045
-		$args     = wp_parse_args( $args, $defaults );
1045
+		$args = wp_parse_args( $args, $defaults );
1046 1046
 
1047 1047
 		$opt_key   = $args['opt_key'];
1048 1048
 		$field     = $args['field'];
@@ -1058,22 +1058,22 @@  discard block
 block discarded – undo
1058 1058
 
1059 1059
 		// Check posted vals before checking saved values
1060 1060
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1061
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) {
1061
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) {
1062 1062
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1063
-				$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 ] ) ) : '';
1063
+				$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] ) ) : '';
1064 1064
 			} else {
1065
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) );
1065
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) );
1066 1066
 			}
1067 1067
 
1068 1068
 			return $other_val;
1069 1069
 
1070
-		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) {
1070
+		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) {
1071 1071
 			// For normal fields
1072 1072
 
1073 1073
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1074
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1074
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1075 1075
 			} else {
1076
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) );
1076
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) );
1077 1077
 			}
1078 1078
 
1079 1079
 			return $other_val;
@@ -1083,8 +1083,8 @@  discard block
 block discarded – undo
1083 1083
 		if ( $field['type'] == 'checkbox' && is_array( $field['value'] ) ) {
1084 1084
 			// Check if there is an "other" val in saved value and make sure the
1085 1085
 			// "other" val is not equal to the Other checkbox option
1086
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1087
-				$other_val = $field['value'][ $opt_key ];
1086
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1087
+				$other_val = $field['value'][$opt_key];
1088 1088
 			}
1089 1089
 		} else {
1090 1090
 			/**
@@ -1096,8 +1096,8 @@  discard block
 block discarded – undo
1096 1096
 				// Multi-select dropdowns - key is not preserved
1097 1097
 				if ( is_array( $field['value'] ) ) {
1098 1098
 					$o_key = array_search( $temp_val, $field['value'] );
1099
-					if ( isset( $field['value'][ $o_key ] ) ) {
1100
-						unset( $field['value'][ $o_key ], $o_key );
1099
+					if ( isset( $field['value'][$o_key] ) ) {
1100
+						unset( $field['value'][$o_key], $o_key );
1101 1101
 					}
1102 1102
 				} elseif ( $temp_val == $field['value'] ) {
1103 1103
 					// For radio and regular dropdowns
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 			return $other_args;
1140 1140
 		}
1141 1141
 
1142
-		$other_opt  = true;
1142
+		$other_opt = true;
1143 1143
 
1144 1144
 		self::set_other_name( $args, $other_args );
1145 1145
 		self::set_other_value( $args, $other_args );
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 		if ( is_array( $val ) ) {
1290 1290
 			foreach ( $val as $k => $v ) {
1291 1291
 				if ( is_string( $v ) ) {
1292
-					$val[ $k ] = str_replace( $replace, $replace_with, $v );
1292
+					$val[$k] = str_replace( $replace, $replace_with, $v );
1293 1293
 					unset( $k, $v );
1294 1294
 				}
1295 1295
 			}
@@ -1628,19 +1628,19 @@  discard block
 block discarded – undo
1628 1628
 	}
1629 1629
 
1630 1630
 	public static function get_bulk_prefilled_opts( array &$prepop ) {
1631
-		$prepop[ __( 'Countries', 'formidable' ) ] = self::get_countries();
1631
+		$prepop[__( 'Countries', 'formidable' )] = self::get_countries();
1632 1632
 
1633 1633
 		$states    = self::get_us_states();
1634 1634
 		$state_abv = array_keys( $states );
1635 1635
 		sort( $state_abv );
1636
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
1636
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
1637 1637
 
1638 1638
 		$states = array_values( $states );
1639 1639
 		sort( $states );
1640
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
1640
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
1641 1641
 		unset( $state_abv, $states );
1642 1642
 
1643
-		$prepop[ __( 'Age', 'formidable' ) ] = array(
1643
+		$prepop[__( 'Age', 'formidable' )] = array(
1644 1644
 			__( 'Under 18', 'formidable' ),
1645 1645
 			__( '18-24', 'formidable' ),
1646 1646
 			__( '25-34', 'formidable' ),
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
 			__( 'Prefer Not to Answer', 'formidable' ),
1652 1652
 		);
1653 1653
 
1654
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = array(
1654
+		$prepop[__( 'Satisfaction', 'formidable' )] = array(
1655 1655
 			__( 'Very Satisfied', 'formidable' ),
1656 1656
 			__( 'Satisfied', 'formidable' ),
1657 1657
 			__( 'Neutral', 'formidable' ),
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 			__( 'N/A', 'formidable' ),
1661 1661
 		);
1662 1662
 
1663
-		$prepop[ __( 'Importance', 'formidable' ) ] = array(
1663
+		$prepop[__( 'Importance', 'formidable' )] = array(
1664 1664
 			__( 'Very Important', 'formidable' ),
1665 1665
 			__( 'Important', 'formidable' ),
1666 1666
 			__( 'Neutral', 'formidable' ),
@@ -1669,7 +1669,7 @@  discard block
 block discarded – undo
1669 1669
 			__( 'N/A', 'formidable' ),
1670 1670
 		);
1671 1671
 
1672
-		$prepop[ __( 'Agreement', 'formidable' ) ] = array(
1672
+		$prepop[__( 'Agreement', 'formidable' )] = array(
1673 1673
 			__( 'Strongly Agree', 'formidable' ),
1674 1674
 			__( 'Agree', 'formidable' ),
1675 1675
 			__( 'Neutral', 'formidable' ),
Please login to merge, or discard this patch.
classes/controllers/FrmWelcomeController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,8 @@
 block discarded – undo
125 125
 		}
126 126
 
127 127
 		// Only do this for single site installs.
128
-		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // WPCS: CSRF ok.
128
+		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) {
129
+// WPCS: CSRF ok.
129 130
 			return;
130 131
 		}
131 132
 
Please login to merge, or discard this patch.
classes/models/FrmInbox.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 			return;
85 85
 		}
86 86
 
87
-		if ( isset( $this->messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) {
87
+		if ( isset( $this->messages[$message['key']] ) && ! isset( $message['force'] ) ) {
88 88
 			// Don't replace messages unless required.
89 89
 			return;
90 90
 		}
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
 			return;
94 94
 		}
95 95
 
96
-		if ( isset( $this->messages[ $message['key'] ] ) ) {
96
+		if ( isset( $this->messages[$message['key']] ) ) {
97 97
 			// Move up and mark as new.
98
-			unset( $this->messages[ $message['key'] ] );
98
+			unset( $this->messages[$message['key']] );
99 99
 		}
100 100
 
101 101
 		$this->fill_message( $message );
102
-		$this->messages[ $message['key'] ] = $message;
102
+		$this->messages[$message['key']] = $message;
103 103
 
104 104
 		$this->update_list();
105 105
 
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	private function clean_messages() {
128 128
 		$removed  = false;
129 129
 		foreach ( $this->messages as $t => $message ) {
130
-			$read    = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' );
131
-			$dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' );
130
+			$read    = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' );
131
+			$dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' );
132 132
 			$expired = $this->is_expired( $message );
133 133
 			if ( $read || $expired || $dismissed ) {
134
-				unset( $this->messages[ $t ] );
134
+				unset( $this->messages[$t] );
135 135
 				$removed = true;
136 136
 			}
137 137
 		}
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 	private function filter_messages( &$messages ) {
145 145
 		$user_id = get_current_user_id();
146 146
 		foreach ( $messages as $k => $message ) {
147
-			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] );
147
+			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] );
148 148
 			if ( empty( $k ) || $this->is_expired( $message ) || $dismissed ) {
149
-				unset( $messages[ $k ] );
149
+				unset( $messages[$k] );
150 150
 			} elseif ( ! $this->is_for_user( $message ) ) {
151
-				unset( $messages[ $k ] );
151
+				unset( $messages[$k] );
152 152
 			}
153 153
 		}
154 154
 		$messages = apply_filters( 'frm_filter_inbox', $messages );
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
 	 * @param string $key
182 182
 	 */
183 183
 	public function mark_read( $key ) {
184
-		if ( ! $key || ! isset( $this->messages[ $key ] ) ) {
184
+		if ( ! $key || ! isset( $this->messages[$key] ) ) {
185 185
 			return;
186 186
 		}
187 187
 
188
-		if ( ! isset( $this->messages[ $key ]['read'] ) ) {
189
-			$this->messages[ $key ]['read'] = array();
188
+		if ( ! isset( $this->messages[$key]['read'] ) ) {
189
+			$this->messages[$key]['read'] = array();
190 190
 		}
191
-		$this->messages[ $key ]['read'][ get_current_user_id() ] = time();
191
+		$this->messages[$key]['read'][get_current_user_id()] = time();
192 192
 
193 193
 		$this->update_list();
194 194
 	}
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
 	 * @since 4.05.02
200 200
 	 */
201 201
 	public function mark_unread( $key ) {
202
-		$is_read = isset( $this->messages[ $key ] ) && isset( $this->messages[ $key ]['read'] ) && isset( $this->messages[ $key ]['read'][ get_current_user_id() ] );
202
+		$is_read = isset( $this->messages[$key] ) && isset( $this->messages[$key]['read'] ) && isset( $this->messages[$key]['read'][get_current_user_id()] );
203 203
 		if ( $is_read ) {
204
-			unset( $this->messages[ $key ]['read'][ get_current_user_id() ] );
204
+			unset( $this->messages[$key]['read'][get_current_user_id()] );
205 205
 			$this->update_list();
206 206
 		}
207 207
 	}
@@ -215,14 +215,14 @@  discard block
 block discarded – undo
215 215
 			return;
216 216
 		}
217 217
 
218
-		if ( ! isset( $this->messages[ $key ] ) ) {
218
+		if ( ! isset( $this->messages[$key] ) ) {
219 219
 			return;
220 220
 		}
221 221
 
222
-		if ( ! isset( $this->messages[ $key ]['dismissed'] ) ) {
223
-			$this->messages[ $key ]['dismissed'] = array();
222
+		if ( ! isset( $this->messages[$key]['dismissed'] ) ) {
223
+			$this->messages[$key]['dismissed'] = array();
224 224
 		}
225
-		$this->messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
225
+		$this->messages[$key]['dismissed'][get_current_user_id()] = time();
226 226
 
227 227
 		$this->update_list();
228 228
 	}
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 		$user_id = get_current_user_id();
235 235
 		foreach ( $this->messages as $key => $message ) {
236 236
 			if ( ! isset( $message['dismissed'] ) ) {
237
-				$this->messages[ $key ]['dismissed'] = array();
237
+				$this->messages[$key]['dismissed'] = array();
238 238
 			}
239 239
 
240
-			if ( ! isset( $message['dismissed'][ $user_id ] ) ) {
241
-				$this->messages[ $key ]['dismissed'][ $user_id ] = time();
240
+			if ( ! isset( $message['dismissed'][$user_id] ) ) {
241
+				$this->messages[$key]['dismissed'][$user_id] = time();
242 242
 			}
243 243
 		}
244 244
 		$this->update_list();
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
 		$messages = $this->get_messages( 'filter' );
249 249
 		$user_id  = get_current_user_id();
250 250
 		foreach ( $messages as $t => $message ) {
251
-			if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) {
252
-				unset( $messages[ $t ] );
251
+			if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) {
252
+				unset( $messages[$t] );
253 253
 			}
254 254
 		}
255 255
 		return $messages;
@@ -273,8 +273,8 @@  discard block
 block discarded – undo
273 273
 	 * @since 4.05.02
274 274
 	 */
275 275
 	public function remove( $key ) {
276
-		if ( isset( $this->messages[ $key ] ) ) {
277
-			unset( $this->messages[ $key ] );
276
+		if ( isset( $this->messages[$key] ) ) {
277
+			unset( $this->messages[$key] );
278 278
 			$this->update_list();
279 279
 		}
280 280
 	}
Please login to merge, or discard this patch.
classes/factories/FrmFieldFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
 			'name'     => 'FrmFieldName',
103 103
 		);
104 104
 
105
-		$class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : '';
105
+		$class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : '';
106 106
 
107 107
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
108 108
 	}
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldCombo.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@
 block discarded – undo
39 39
 			}
40 40
 
41 41
 			foreach ( $sub_field['options'] as $option ) {
42
-				if ( 'default_value' === $option ) { // We parse default value from field column.
42
+				if ( 'default_value' === $option ) {
43
+// We parse default value from field column.
43 44
 					continue;
44 45
 				}
45 46
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 			if ( is_array( $sub_field ) ) {
60 60
 				$sub_field                 = wp_parse_args( $sub_field, $defaults );
61 61
 				$sub_field['name']         = $name;
62
-				$this->sub_fields[ $name ] = $sub_field;
62
+				$this->sub_fields[$name] = $sub_field;
63 63
 				continue;
64 64
 			}
65 65
 
66 66
 			if ( is_string( $sub_field ) ) {
67
-				$this->sub_fields[ $name ] = wp_parse_args(
67
+				$this->sub_fields[$name] = wp_parse_args(
68 68
 					array(
69 69
 						'name'  => $name,
70 70
 						'label' => $sub_field,
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 				}
117 117
 
118 118
 				if ( is_string( $option ) ) {
119
-					$extra_options[ $key . '_' . $option ] = '';
119
+					$extra_options[$key . '_' . $option] = '';
120 120
 				} elseif ( ! empty( $option['name'] ) ) {
121
-					$extra_options[ $key . '_' . $option['name'] ] = '';
121
+					$extra_options[$key . '_' . $option['name']] = '';
122 122
 				}
123 123
 			}
124 124
 		}
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		foreach ( $this->sub_fields as $name => $sub_field ) {
142 142
 			$sub_field['name'] = $name;
143 143
 			$wrapper_classes   = 'frm_grid_container frm_sub_field_options frm_sub_field_options-' . $sub_field['name'];
144
-			if ( ! isset( $processed_sub_fields[ $name ] ) ) {
144
+			if ( ! isset( $processed_sub_fields[$name] ) ) {
145 145
 				// Options for this subfield should be hidden.
146 146
 				$wrapper_classes .= ' frm_hidden';
147 147
 			}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 			$default_value = array();
172 172
 
173 173
 			foreach ( $this->sub_fields as $name => $sub_field ) {
174
-				$default_value[ $name ] = '';
174
+				$default_value[$name] = '';
175 175
 			}
176 176
 
177 177
 			return $default_value;
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
 		// Placeholder.
343 343
 		if ( in_array( 'placeholder', $sub_field['options'], true ) ) {
344 344
 			$placeholders = FrmField::get_option( $field, 'placeholder' );
345
-			if ( ! empty( $placeholders[ $sub_field['name'] ] ) ) {
346
-				$atts[] = 'placeholder="' . esc_attr( $placeholders[ $sub_field['name'] ] ) . '"';
345
+			if ( ! empty( $placeholders[$sub_field['name']] ) ) {
346
+				$atts[] = 'placeholder="' . esc_attr( $placeholders[$sub_field['name']] ) . '"';
347 347
 			}
348 348
 		}
349 349
 
@@ -390,9 +390,9 @@  discard block
 block discarded – undo
390 390
 
391 391
 		// Validate not empty.
392 392
 		foreach ( $sub_fields as $name => $sub_field ) {
393
-			if ( empty( $sub_field['optional'] ) && empty( $args['value'][ $name ] ) ) {
394
-				$errors[ 'field' . $args['id'] . '-' . $name ] = '';
395
-				$errors[ 'field' . $args['id'] ]               = $blank_msg;
393
+			if ( empty( $sub_field['optional'] ) && empty( $args['value'][$name] ) ) {
394
+				$errors['field' . $args['id'] . '-' . $name] = '';
395
+				$errors['field' . $args['id']]               = $blank_msg;
396 396
 			}
397 397
 		}
398 398
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 		$field_key  = isset( $this->field->field_key ) ? $this->field->field_key : $this->field['field_key'];
412 412
 		$sub_fields = $this->get_processed_sub_fields();
413 413
 		foreach ( $sub_fields as $name => $sub_field ) {
414
-			$headings[ $field_id . '_' . $name ] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label'];
414
+			$headings[$field_id . '_' . $name] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label'];
415 415
 		}
416 416
 
417 417
 		return $headings;
Please login to merge, or discard this patch.