Completed
Pull Request — master (#2604)
by
unknown
44s
created
stripe/helpers/FrmTransLiteAppHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public static function show_status( $status ) {
68 68
 		$statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() );
69
-		return $statuses[ $status ] ?? $status;
69
+		return $statuses[$status] ?? $status;
70 70
 	}
71 71
 
72 72
 	/**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public static function get_action_setting( $option, $atts ) {
154 154
 		$settings = self::get_action_settings( $atts );
155
-		$value    = $settings[ $option ] ?? '';
155
+		$value    = $settings[$option] ?? '';
156 156
 		return $value;
157 157
 	}
158 158
 
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
 	 */
256 256
 	public static function get_repeat_label_from_value( $value, $number ) {
257 257
 		$times = self::get_plural_repeat_times( $number );
258
-		if ( isset( $times[ $value ] ) ) {
259
-			$value = $times[ $value ];
258
+		if ( isset( $times[$value] ) ) {
259
+			$value = $times[$value];
260 260
 		}
261 261
 		return $value;
262 262
 	}
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 		$count = 0;
505 505
 		foreach ( $payments as $payment ) {
506 506
 			if ( $payment->status === 'complete' ) {
507
-				$count++;
507
+				$count ++;
508 508
 			}
509 509
 		}
510 510
 
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 		if ( is_array( $gateway ) ) {
527 527
 			$gateway = reset( $gateway );
528 528
 		}
529
-		if ( isset( $gateways[ $gateway ] ) ) {
530
-			$value = $gateways[ $gateway ][ $setting ];
529
+		if ( isset( $gateways[$gateway] ) ) {
530
+			$value = $gateways[$gateway][$setting];
531 531
 		}
532 532
 		return $value;
533 533
 	}
Please login to merge, or discard this patch.
classes/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 	$event_labels = FrmFormAction::trigger_labels();
44 44
 	foreach ( $action_control->action_options['event'] as $event ) {
45 45
 		?>
46
-		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option>
46
+		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[$event] ?? $event ); ?></option>
47 47
 <?php } ?>
48 48
 		</select>
49 49
 	</p>
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/combo-field/sub-field-options.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 				?>
41 41
 				<p class="frm6 frm_form_field">
42 42
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
43
-						<?php echo esc_html( $labels[ $option ] ); ?>
43
+						<?php echo esc_html( $labels[$option] ); ?>
44 44
 					</label>
45 45
 					<span class="frm-with-right-icon">
46 46
 						<input
47 47
 							type="text"
48 48
 							name="<?php echo esc_attr( $input_name ); ?>"
49 49
 							id="<?php echo esc_attr( $input_id ); ?>"
50
-							value="<?php echo esc_attr( $default_value[ $sub_field['name'] ] ?? '' ); ?>"
50
+							value="<?php echo esc_attr( $default_value[$sub_field['name']] ?? '' ); ?>"
51 51
 							data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>"
52 52
 							data-changeatt="value"
53 53
 						/>
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 				?>
74 74
 				<p class="frm6 frm_form_field">
75 75
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
76
-						<?php echo esc_html( $labels[ $option ] ); ?>
76
+						<?php echo esc_html( $labels[$option] ); ?>
77 77
 					</label>
78 78
 					<input
79 79
 						type="text"
80 80
 						name="<?php echo esc_attr( $input_name ); ?>"
81 81
 						id="<?php echo esc_attr( $input_id ); ?>"
82
-						value="<?php echo esc_attr( $input_value[ $sub_field['name'] ] ?? '' ); ?>"
82
+						value="<?php echo esc_attr( $input_value[$sub_field['name']] ?? '' ); ?>"
83 83
 						data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>"
84 84
 						data-changeatt="<?php echo esc_attr( $option ); ?>"
85 85
 					/>
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 				?>
96 96
 				<p class="frm_form_field frm-flex-col">
97 97
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
98
-						<?php echo esc_html( $labels[ $option ] ); ?>
98
+						<?php echo esc_html( $labels[$option] ); ?>
99 99
 					</label>
100 100
 					<textarea
101 101
 						name="<?php echo esc_attr( $input_name ); ?>"
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/combo-field/combo-field.php 1 patch
Spacing   +6 added lines, -6 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
 			?>
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 						$attrs = array(
61 61
 							'type'  => $sub_field['type'],
62 62
 							'id'    => $html_id . '_' . $name,
63
-							'value' => $field_value[ $name ] ?? '',
63
+							'value' => $field_value[$name] ?? '',
64 64
 						);
65 65
 
66
-						if ( ! empty( $field_value[ $name ] ) ) {
67
-							$attrs['data-frmval'] = $field_value[ $name ];
66
+						if ( ! empty( $field_value[$name] ) ) {
67
+							$attrs['data-frmval'] = $field_value[$name];
68 68
 						}
69 69
 						if ( empty( $args['remove_names'] ) ) {
70 70
 							$attrs['name'] = $field_name . '[' . $name . ']';
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 				}
82 82
 
83 83
 				// Don't show individual field errors when there is a combo field error.
84
-				if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) {
84
+				if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) {
85 85
 					?>
86
-					<div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div>
86
+					<div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div>
87 87
 				<?php } ?>
88 88
 			</div>
89 89
 			<?php
Please login to merge, or discard this patch.
classes/views/solutions/_import.php 1 patch
Spacing   +3 added lines, -3 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      = $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' ) { ?>
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 							}
55 55
 
56 56
 							if ( $importing === 'form' && $disabled ) {
57
-								FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) );
57
+								FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) );
58 58
 							} else {
59 59
 								echo esc_html( $info['name'] );
60 60
 							}
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
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
 			FrmFieldGdprHelper::FIELD_TYPE => FrmFieldGdprHelper::get_gdpr_field_class( $field_type ),
113 113
 		);
114 114
 
115
-		$class = $type_classes[ $field_type ] ?? '';
115
+		$class = $type_classes[$field_type] ?? '';
116 116
 
117 117
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
118 118
 	}
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldUserID.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 	protected function get_field_value( $args ) {
59 59
 		$user_ID      = get_current_user_id();
60 60
 		$user_ID      = ( $user_ID ? $user_ID : '' );
61
-		$posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
61
+		$posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
62 62
 		$action       = ( $args['action'] ?? $args['form_action'] ?? '' );
63 63
 		$updating     = $action === 'update';
64 64
 		return is_numeric( $this->field['value'] ) || $posted_value || $updating ? $this->field['value'] : $user_ID;
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldType.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
 		$field_val = '';
157 157
 		if ( is_object( $this->field ) ) {
158 158
 			$field_val = $this->field->{$column};
159
-		} elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) {
160
-			$field_val = $this->field[ $column ];
159
+		} elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) {
160
+			$field_val = $this->field[$column];
161 161
 		}
162 162
 
163 163
 		return $field_val;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		if ( is_object( $this->field ) ) {
172 172
 			$this->field->{$column} = $value;
173 173
 		} elseif ( is_array( $this->field ) ) {
174
-			$this->field[ $column ] = $value;
174
+			$this->field[$column] = $value;
175 175
 		}
176 176
 	}
177 177
 
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 			printf(
652 652
 				/* translators: %s: Field type */
653 653
 				esc_html__( '%s Options', 'formidable' ),
654
-				esc_html( $all_field_types[ $args['display']['type'] ]['name'] )
654
+				esc_html( $all_field_types[$args['display']['type']]['name'] )
655 655
 			);
656 656
 			FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) );
657 657
 			?>
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 	 * New field
752 752
 	 */
753 753
 	public function get_new_field_defaults() {
754
-		$field        = array(
754
+		$field = array(
755 755
 			'name'          => $this->get_new_field_name(),
756 756
 			'description'   => '',
757 757
 			'type'          => $this->type,
@@ -782,8 +782,8 @@  discard block
 block discarded – undo
782 782
 
783 783
 		$fields = array_merge( $fields, $pro_fields );
784 784
 
785
-		if ( isset( $fields[ $this->type ] ) ) {
786
-			$name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ];
785
+		if ( isset( $fields[$this->type] ) ) {
786
+			$name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type];
787 787
 		}
788 788
 
789 789
 		return $name;
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 	 * @return array
801 801
 	 */
802 802
 	public function get_default_field_options() {
803
-		$opts        = array(
803
+		$opts = array(
804 804
 			'size'               => '',
805 805
 			'max'                => '',
806 806
 			'label'              => '',
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
 	 * @return void
1045 1045
 	 */
1046 1046
 	public function set_aria_invalid_error( &$shortcode_atts, $args ) {
1047
-		$shortcode_atts['aria-invalid'] = isset( $args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false';
1047
+		$shortcode_atts['aria-invalid'] = isset( $args['errors']['field' . $this->field_id] ) ? 'true' : 'false';
1048 1048
 	}
1049 1049
 
1050 1050
 	/**
@@ -1204,11 +1204,11 @@  discard block
 block discarded – undo
1204 1204
 		}
1205 1205
 
1206 1206
 		$options = array_values( $this->field['options'] );
1207
-		if ( ! isset( $options[ $opt ] ) ) {
1207
+		if ( ! isset( $options[$opt] ) ) {
1208 1208
 			return $hidden;
1209 1209
 		}
1210 1210
 
1211
-		$option = $options[ $opt ];
1211
+		$option = $options[$opt];
1212 1212
 		if ( is_array( $option ) ) {
1213 1213
 			$option = $option['value'];
1214 1214
 		}
@@ -1272,8 +1272,8 @@  discard block
 block discarded – undo
1272 1272
 		$selected = $values['field_value'];
1273 1273
 
1274 1274
 		if ( isset( $values['combo_name'] ) ) {
1275
-			$options  = $options[ $values['combo_name'] ];
1276
-			$selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : '';
1275
+			$options  = $options[$values['combo_name']];
1276
+			$selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : '';
1277 1277
 		}
1278 1278
 
1279 1279
 		$input = $this->select_tag( $values );
@@ -1328,7 +1328,7 @@  discard block
 block discarded – undo
1328 1328
 	}
1329 1329
 
1330 1330
 	protected function fill_display_field_values( $args = array() ) {
1331
-		$defaults        = array(
1331
+		$defaults = array(
1332 1332
 			'field_name'    => 'item_meta[' . $this->get_field_column( 'id' ) . ']',
1333 1333
 			'field_id'      => $this->get_field_column( 'id' ),
1334 1334
 			'field_plus_id' => '',
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 			}
1386 1386
 		}
1387 1387
 
1388
-		if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) {
1388
+		if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) {
1389 1389
 			if ( $error_comes_first ) {
1390 1390
 				array_unshift( $describedby, 'frm_error_' . $args['html_id'] );
1391 1391
 			} else {
@@ -1463,11 +1463,11 @@  discard block
 block discarded – undo
1463 1463
 
1464 1464
 		$field_id = $this->get_field_column( 'id' );
1465 1465
 		if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) {
1466
-			$frm_validated_unique_values[ $field_id ] = array();
1466
+			$frm_validated_unique_values[$field_id] = array();
1467 1467
 			return false;
1468 1468
 		}
1469 1469
 
1470
-		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true );
1470
+		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true );
1471 1471
 		return $already_validated_this_value;
1472 1472
 	}
1473 1473
 
@@ -1492,7 +1492,7 @@  discard block
 block discarded – undo
1492 1492
 	private function value_validated_as_unique( $value ) {
1493 1493
 		global $frm_validated_unique_values;
1494 1494
 		$field_id                                   = $this->get_field_column( 'id' );
1495
-		$frm_validated_unique_values[ $field_id ][] = $value;
1495
+		$frm_validated_unique_values[$field_id][] = $value;
1496 1496
 	}
1497 1497
 
1498 1498
 	/**
@@ -1537,8 +1537,8 @@  discard block
 block discarded – undo
1537 1537
 		$value = $this->prepare_display_value( $value, $atts );
1538 1538
 
1539 1539
 		if ( is_array( $value ) ) {
1540
-			if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) {
1541
-				$value = $value[ $atts['show'] ];
1540
+			if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) {
1541
+				$value = $value[$atts['show']];
1542 1542
 			} elseif ( empty( $atts['return_array'] ) ) {
1543 1543
 				$sep   = $atts['sep'] ?? ', ';
1544 1544
 				$value = FrmAppHelper::safe_implode( $sep, $value );
@@ -1668,8 +1668,8 @@  discard block
 block discarded – undo
1668 1668
 		$saved_entries = $atts['ids'];
1669 1669
 		$new_value     = array();
1670 1670
 		foreach ( (array) $value as $old_child_id ) {
1671
-			if ( isset( $saved_entries[ $old_child_id ] ) ) {
1672
-				$new_value[] = $saved_entries[ $old_child_id ];
1671
+			if ( isset( $saved_entries[$old_child_id] ) ) {
1672
+				$new_value[] = $saved_entries[$old_child_id];
1673 1673
 			}
1674 1674
 		}
1675 1675
 
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldCombo.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 			if ( is_array( $sub_field ) ) {
62 62
 				$sub_field                 = wp_parse_args( $sub_field, $defaults );
63 63
 				$sub_field['name']         = $name;
64
-				$this->sub_fields[ $name ] = $sub_field;
64
+				$this->sub_fields[$name] = $sub_field;
65 65
 				continue;
66 66
 			}
67 67
 
68 68
 			if ( is_string( $sub_field ) ) {
69
-				$this->sub_fields[ $name ] = wp_parse_args(
69
+				$this->sub_fields[$name] = wp_parse_args(
70 70
 					array(
71 71
 						'name'  => $name,
72 72
 						'label' => $sub_field,
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function set_aria_invalid_error( &$shortcode_atts, $args ) {
91 91
 		foreach ( $this->get_sub_fields() as $sub_field ) {
92
-			$shortcode_atts[ 'aria-invalid-' . $sub_field['name'] ] = isset( $args['errors'][ 'field' . $this->field_id . '-' . $sub_field['name'] ] ) ? 'true' : 'false';
92
+			$shortcode_atts['aria-invalid-' . $sub_field['name']] = isset( $args['errors']['field' . $this->field_id . '-' . $sub_field['name']] ) ? 'true' : 'false';
93 93
 		}
94 94
 	}
95 95
 
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 				}
136 136
 
137 137
 				if ( is_string( $option ) ) {
138
-					$extra_options[ $key . '_' . $option ] = '';
138
+					$extra_options[$key . '_' . $option] = '';
139 139
 				} elseif ( ! empty( $option['name'] ) ) {
140
-					$extra_options[ $key . '_' . $option['name'] ] = '';
140
+					$extra_options[$key . '_' . $option['name']] = '';
141 141
 				}
142 142
 			}
143 143
 		}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		foreach ( $this->sub_fields as $name => $sub_field ) {
164 164
 			$sub_field['name'] = $name;
165 165
 			$wrapper_classes   = 'frm_grid_container frm_sub_field_options frm_sub_field_options-' . $sub_field['name'];
166
-			if ( ! isset( $processed_sub_fields[ $name ] ) ) {
166
+			if ( ! isset( $processed_sub_fields[$name] ) ) {
167 167
 				// Options for this subfield should be hidden.
168 168
 				$wrapper_classes .= ' frm_hidden';
169 169
 			}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 			$default_value = array();
194 194
 
195 195
 			foreach ( $this->sub_fields as $name => $sub_field ) {
196
-				$default_value[ $name ] = '';
196
+				$default_value[$name] = '';
197 197
 			}
198 198
 
199 199
 			return $default_value;
@@ -375,8 +375,8 @@  discard block
 block discarded – undo
375 375
 		// Placeholder.
376 376
 		if ( in_array( 'placeholder', $sub_field['options'], true ) ) {
377 377
 			$placeholders = FrmField::get_option( $field, 'placeholder' );
378
-			if ( ! empty( $placeholders[ $sub_field['name'] ] ) ) {
379
-				$field['placeholder'] = $placeholders[ $sub_field['name'] ];
378
+			if ( ! empty( $placeholders[$sub_field['name']] ) ) {
379
+				$field['placeholder'] = $placeholders[$sub_field['name']];
380 380
 			}
381 381
 		}
382 382
 
@@ -437,9 +437,9 @@  discard block
 block discarded – undo
437 437
 
438 438
 		// Validate not empty.
439 439
 		foreach ( $sub_fields as $name => $sub_field ) {
440
-			if ( empty( $sub_field['optional'] ) && empty( $args['value'][ $name ] ) ) {
441
-				$errors[ 'field' . $args['id'] . '-' . $name ] = '';
442
-				$errors[ 'field' . $args['id'] ]               = $blank_msg;
440
+			if ( empty( $sub_field['optional'] ) && empty( $args['value'][$name] ) ) {
441
+				$errors['field' . $args['id'] . '-' . $name] = '';
442
+				$errors['field' . $args['id']]               = $blank_msg;
443 443
 			}
444 444
 		}
445 445
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 		$field_key  = $this->field->field_key ?? $this->field['field_key'];
459 459
 		$sub_fields = $this->get_processed_sub_fields();
460 460
 		foreach ( $sub_fields as $name => $sub_field ) {
461
-			$headings[ $field_id . '_' . $name ] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label'];
461
+			$headings[$field_id . '_' . $name] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label'];
462 462
 		}
463 463
 
464 464
 		return $headings;
Please login to merge, or discard this patch.