Completed
Pull Request — master (#485)
by Stephanie
41s
created
classes/models/fields/FrmFieldCaptcha.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -144,11 +144,11 @@
 block discarded – undo
144 144
 		if ( isset( $response['success'] ) && ! $response['success'] ) {
145 145
 			// What happens when the CAPTCHA was entered incorrectly
146 146
 			$invalid_message                 = FrmField::get_option( $this->field, 'invalid' );
147
-			$errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message );
147
+			$errors['field' . $args['id']] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message );
148 148
 		} elseif ( is_wp_error( $resp ) ) {
149 149
 			$error_string                     = $resp->get_error_message();
150
-			$errors[ 'field' . $args['id'] ]  = __( 'There was a problem verifying your recaptcha', 'formidable' );
151
-			$errors[ 'field' . $args['id'] ] .= ' ' . $error_string;
150
+			$errors['field' . $args['id']]  = __( 'There was a problem verifying your recaptcha', 'formidable' );
151
+			$errors['field' . $args['id']] .= ' ' . $error_string;
152 152
 		}
153 153
 
154 154
 		return $errors;
Please login to merge, or discard this patch.
classes/models/FrmFieldFormHtml.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	 * @param array $atts
42 42
 	 */
43 43
 	private function _set( $param, $atts ) {
44
-		if ( isset( $atts[ $param ] ) ) {
45
-			$this->{$param} = $atts[ $param ];
44
+		if ( isset( $atts[$param] ) ) {
45
+			$this->{$param} = $atts[$param];
46 46
 		}
47 47
 	}
48 48
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 
87 87
 		$exclude = array( 'field_obj', 'html' );
88 88
 		foreach ( $exclude as $ex ) {
89
-			if ( isset( $atts[ $ex ] ) ) {
90
-				unset( $this->pass_args[ $ex ] );
89
+			if ( isset( $atts[$ex] ) ) {
90
+				unset( $this->pass_args[$ex] );
91 91
 			}
92 92
 		}
93 93
 	}
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	 * @param array $set
100 100
 	 */
101 101
 	private function set_from_field( $atts, $set ) {
102
-		if ( isset( $atts[ $set['param'] ] ) ) {
103
-			$this->{$set['param']} = $atts[ $set['param'] ];
102
+		if ( isset( $atts[$set['param']] ) ) {
103
+			$this->{$set['param']} = $atts[$set['param']];
104 104
 		} else {
105 105
 			$this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] );
106 106
 		}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	private function replace_error_shortcode() {
227 227
 		$this->maybe_add_error_id();
228
-		$error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false;
228
+		$error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false;
229 229
 		FrmShortcodeHelper::remove_inline_conditions( ! empty( $error ), 'error', $error, $this->html );
230 230
 	}
231 231
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	 * @since 3.06.02
237 237
 	 */
238 238
 	private function maybe_add_error_id() {
239
-		if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
239
+		if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
240 240
 			return;
241 241
 		}
242 242
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER );
317 317
 
318 318
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
319
-			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
319
+			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
320 320
 			$tag            = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
321 321
 
322 322
 			$replace_with = '';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				$replace_with = $this->replace_input_shortcode( $shortcode_atts );
328 328
 			}
329 329
 
330
-			$this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html );
330
+			$this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html );
331 331
 		}
332 332
 	}
333 333
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 			unset( $shortcode_atts['class'] );
360 360
 		}
361 361
 
362
-		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false';
362
+		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? 'true' : 'false';
363 363
 
364 364
 		$this->field_obj->set_field_column( 'shortcodes', $shortcode_atts );
365 365
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 	 */
415 415
 	private function get_field_div_classes() {
416 416
 		// Add error class
417
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
417
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
418 418
 
419 419
 		// Add label position class
420 420
 		$settings = $this->field_obj->display_field_settings();
Please login to merge, or discard this patch.
classes/controllers/FrmXMLController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			return;
122 122
 		}
123 123
 
124
-		$selected_xml  = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : '';
124
+		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : '';
125 125
 		if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) {
126 126
 			return;
127 127
 		}
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 	 * @since 4.06.02
134 134
 	 */
135 135
 	private static function get_selected_in_form( $form, $value = 'form' ) {
136
-		if ( ! empty( $form ) && isset( $form[ $value ] ) && ! empty( $form[ $value ] ) ) {
137
-			return $form[ $value ];
136
+		if ( ! empty( $form ) && isset( $form[$value] ) && ! empty( $form[$value] ) ) {
137
+			return $form[$value];
138 138
 		}
139 139
 
140 140
 		return '';
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			}
164 164
 
165 165
 			if ( $for === 'view' ) {
166
-				$item_key  = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys;
166
+				$item_key  = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys;
167 167
 				$shortcode = '[display-frm-data id=%1$s filter=limited]';
168 168
 			} elseif ( $for === 'form' ) {
169 169
 				$item_key = $form_key;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 				continue;
179 179
 			}
180 180
 
181
-			$page_ids[ $for ] = wp_insert_post(
181
+			$page_ids[$for] = wp_insert_post(
182 182
 				array(
183 183
 					'post_title'   => $name,
184 184
 					'post_type'    => 'page',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
320 320
 		$file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] );
321 321
 		$file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) );
322
-		if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
322
+		if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) {
323 323
 			// allow other file types to be imported
324 324
 			do_action( 'frm_before_import_' . $file_type );
325 325
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 		foreach ( $type as $tb_type ) {
403 403
 			$where = array();
404 404
 			$join  = '';
405
-			$table = $tables[ $tb_type ];
405
+			$table = $tables[$tb_type];
406 406
 
407 407
 			$select     = $table . '.id';
408 408
 			$query_vars = array();
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 							$table . '.parent_form_id' => $args['ids'],
418 418
 						);
419 419
 					} else {
420
-						$where[ $table . '.status !' ] = 'draft';
420
+						$where[$table . '.status !'] = 'draft';
421 421
 					}
422 422
 					break;
423 423
 				case 'actions':
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 				case 'items':
431 431
 					// $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
432 432
 					if ( $args['ids'] ) {
433
-						$where[ $table . '.form_id' ] = $args['ids'];
433
+						$where[$table . '.form_id'] = $args['ids'];
434 434
 					}
435 435
 					break;
436 436
 				case 'styles':
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 					}
472 472
 			}
473 473
 
474
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
474
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
475 475
 			unset( $tb_type );
476 476
 		}
477 477
 
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 		$no_export_fields = FrmField::no_save_fields();
617 617
 		foreach ( $csv_fields as $k => $f ) {
618 618
 			if ( in_array( $f->type, $no_export_fields, true ) ) {
619
-				unset( $csv_fields[ $k ] );
619
+				unset( $csv_fields[$k] );
620 620
 			}
621 621
 		}
622 622
 
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/field-multiple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
 	$type = $field['type'];
10 10
 	do_action( 'frm_after_checkbox', compact( 'field', 'field_name', 'type' ) );
11 11
 } else {
12
-	$read_only  = $field['read_only'];
12
+	$read_only = $field['read_only'];
13 13
 	include dirname( __FILE__ ) . '/' . $field['type'] . '-field.php';
14 14
 }
Please login to merge, or discard this patch.
classes/views/frm-forms/list-templates.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 	</li><?php
17 17
 	$render_icon = true;
18 18
 	foreach ( array( 20872734, 20874748, 20882522, 20874739 ) as $template ) {
19
-		if ( isset( $templates[ $template ] ) ) {
20
-			$template = $templates[ $template ];
19
+		if ( isset( $templates[$template] ) ) {
20
+			$template = $templates[$template];
21 21
 			require $view_path . 'list-template.php';
22 22
 		}
23 23
 	}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	<ul class="frm-templates-list frm-categories-list">
46 46
 		<?php foreach ( $categories as $category ) { ?>
47 47
 			<?php
48
-			$category_templates = $templates_by_category[ $category ];
48
+			$category_templates = $templates_by_category[$category];
49 49
 			$count              = count( $category_templates );
50 50
 			$available          = FrmFormsHelper::available_count( $category_templates, $args );
51 51
 			?>
Please login to merge, or discard this patch.
classes/controllers/FrmAppController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -283,7 +283,7 @@
 block discarded – undo
283 283
 				'content' => 'upgrade',
284 284
 			)
285 285
 		);
286
-		$renew_link       = FrmAppHelper::admin_upgrade_link(
286
+		$renew_link = FrmAppHelper::admin_upgrade_link(
287 287
 			array(
288 288
 				'medium'  => 'new-template',
289 289
 				'content' => 'renew',
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldType.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 		$field_val = '';
133 133
 		if ( is_object( $this->field ) ) {
134 134
 			$field_val = $this->field->{$column};
135
-		} elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) {
136
-			$field_val = $this->field[ $column ];
135
+		} elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) {
136
+			$field_val = $this->field[$column];
137 137
 		}
138 138
 
139 139
 		return $field_val;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		if ( is_object( $this->field ) ) {
148 148
 			$this->field->{$column} = $value;
149 149
 		} elseif ( is_array( $this->field ) ) {
150
-			$this->field[ $column ] = $value;
150
+			$this->field[$column] = $value;
151 151
 		}
152 152
 	}
153 153
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 			printf(
470 470
 				/* translators: %s: Field type */
471 471
 				esc_html__( '%s Options', 'formidable' ),
472
-				esc_html( $all_field_types[ $args['display']['type'] ]['name'] )
472
+				esc_html( $all_field_types[$args['display']['type']]['name'] )
473 473
 			);
474 474
 			?>
475 475
 			<i class="frm_icon_font frm_arrowdown6_icon"></i>
@@ -592,8 +592,8 @@  discard block
 block discarded – undo
592 592
 		$fields = FrmField::field_selection();
593 593
 		$fields = array_merge( $fields, FrmField::pro_field_selection() );
594 594
 
595
-		if ( isset( $fields[ $this->type ] ) ) {
596
-			$name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ];
595
+		if ( isset( $fields[$this->type] ) ) {
596
+			$name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type];
597 597
 		}
598 598
 
599 599
 		return $name;
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 	}
605 605
 
606 606
 	public function get_default_field_options() {
607
-		$opts       = array(
607
+		$opts = array(
608 608
 			'size'               => '',
609 609
 			'max'                => '',
610 610
 			'label'              => '',
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 			}
943 943
 		} else {
944 944
 			$args['save_array'] = $this->is_readonly_array();
945
-			$hidden             .= $this->show_single_hidden( $selected_value, $args );
945
+			$hidden .= $this->show_single_hidden( $selected_value, $args );
946 946
 		}
947 947
 
948 948
 		return $hidden;
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 	protected function show_single_hidden( $selected, $args ) {
952 952
 		if ( $args['save_array'] ) {
953 953
 			$args['field_name'] .= '[]';
954
-			$id                 = '';
954
+			$id = '';
955 955
 		} else {
956 956
 			$id = ' id="' . esc_attr( $args['html_id'] ) . '"';
957 957
 		}
@@ -967,8 +967,8 @@  discard block
 block discarded – undo
967 967
 		$selected = $values['field_value'];
968 968
 
969 969
 		if ( isset( $values['combo_name'] ) ) {
970
-			$options  = $options[ $values['combo_name'] ];
971
-			$selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : '';
970
+			$options  = $options[$values['combo_name']];
971
+			$selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : '';
972 972
 		}
973 973
 
974 974
 		$input = $this->select_tag( $values );
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
 	}
1020 1020
 
1021 1021
 	protected function fill_display_field_values( $args = array() ) {
1022
-		$defaults        = array(
1022
+		$defaults = array(
1023 1023
 			'field_name'    => 'item_meta[' . $this->get_field_column( 'id' ) . ']',
1024 1024
 			'field_id'      => $this->get_field_column( 'id' ),
1025 1025
 			'field_plus_id' => '',
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 			$describedby = 'frm_desc_' . $args['html_id'];
1058 1058
 		}
1059 1059
 
1060
-		if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) ) {
1060
+		if ( isset( $args['errors']['field' . $args['field_id']] ) ) {
1061 1061
 			$describedby .= ' frm_error_' . $args['html_id'];
1062 1062
 		}
1063 1063
 
@@ -1116,11 +1116,11 @@  discard block
 block discarded – undo
1116 1116
 
1117 1117
 		$field_id = $this->get_field_column( 'id' );
1118 1118
 		if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) {
1119
-			$frm_validated_unique_values[ $field_id ] = array();
1119
+			$frm_validated_unique_values[$field_id] = array();
1120 1120
 			return false;
1121 1121
 		}
1122 1122
 
1123
-		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true );
1123
+		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true );
1124 1124
 		return $already_validated_this_value;
1125 1125
 	}
1126 1126
 
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
 	private function value_validated_as_unique( $value ) {
1146 1146
 		global $frm_validated_unique_values;
1147 1147
 		$field_id                                   = $this->get_field_column( 'id' );
1148
-		$frm_validated_unique_values[ $field_id ][] = $value;
1148
+		$frm_validated_unique_values[$field_id][] = $value;
1149 1149
 	}
1150 1150
 
1151 1151
 	public function get_value_to_save( $value, $atts ) {
@@ -1177,8 +1177,8 @@  discard block
 block discarded – undo
1177 1177
 		$value = $this->prepare_display_value( $value, $atts );
1178 1178
 
1179 1179
 		if ( is_array( $value ) ) {
1180
-			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) {
1181
-				$value = $value[ $atts['show'] ];
1180
+			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) {
1181
+				$value = $value[$atts['show']];
1182 1182
 			} elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) {
1183 1183
 				$sep   = isset( $atts['sep'] ) ? $atts['sep'] : ', ';
1184 1184
 				$value = implode( $sep, $value );
@@ -1247,8 +1247,8 @@  discard block
 block discarded – undo
1247 1247
 		$saved_entries = $atts['ids'];
1248 1248
 		$new_value     = array();
1249 1249
 		foreach ( (array) $value as $old_child_id ) {
1250
-			if ( isset( $saved_entries[ $old_child_id ] ) ) {
1251
-				$new_value[] = $saved_entries[ $old_child_id ];
1250
+			if ( isset( $saved_entries[$old_child_id] ) ) {
1251
+				$new_value[] = $saved_entries[$old_child_id];
1252 1252
 			}
1253 1253
 		}
1254 1254
 
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 1 patch
Spacing   +22 added lines, -22 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 );
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	public static function fill_form_options( &$options, $values ) {
386 386
 		$defaults = self::get_default_opts();
387 387
 		foreach ( $defaults as $var => $default ) {
388
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
388
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
389 389
 			unset( $var, $default );
390 390
 		}
391 391
 	}
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	public static function insert_opt_html( $args ) {
542 542
 		$class  = isset( $args['class'] ) ? $args['class'] : '';
543 543
 		$fields = FrmField::all_field_selection();
544
-		$field  = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array();
544
+		$field  = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array();
545 545
 
546 546
 		self::prepare_field_type( $field );
547 547
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 			FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) );
694 694
 		}
695 695
 
696
-		$add_order    += 2;
696
+		$add_order += 2;
697 697
 		$open         = false;
698 698
 		$reset_fields = true;
699 699
 	}
@@ -1045,10 +1045,10 @@  discard block
 block discarded – undo
1045 1045
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1046 1046
 			}
1047 1047
 
1048
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
1049
-			if ( $length == 'icon' && isset( $link_details[ $length ] ) ) {
1048
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
1049
+			if ( $length == 'icon' && isset( $link_details[$length] ) ) {
1050 1050
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1051
-				$link  .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1051
+				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1052 1052
 			}
1053 1053
 
1054 1054
 			$link .= '>' . $label . '</a>';
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 			$status = 'publish';
1205 1205
 		}
1206 1206
 
1207
-		$name = $nice_names[ $status ];
1207
+		$name = $nice_names[$status];
1208 1208
 
1209 1209
 		return $name;
1210 1210
 	}
@@ -1237,17 +1237,17 @@  discard block
 block discarded – undo
1237 1237
 			''                    => array( 'align_right' ),
1238 1238
 		);
1239 1239
 
1240
-		$icons[ __( 'My Templates', 'formidable' ) ] = array( 'user', 'var(--orange)' );
1240
+		$icons[__( 'My Templates', 'formidable' )] = array( 'user', 'var(--orange)' );
1241 1241
 
1242 1242
 		$icon = $icons[''];
1243 1243
 
1244 1244
 		if ( count( $categories ) === 1 ) {
1245 1245
 			$category = reset( $categories );
1246
-			$icon     = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon;
1246
+			$icon     = isset( $icons[$category] ) ? $icons[$category] : $icon;
1247 1247
 		} elseif ( ! empty( $categories ) ) {
1248 1248
 			foreach ( $icons as $cat => $icon ) {
1249 1249
 				if ( ! in_array( $cat, $categories ) ) {
1250
-					unset( $icons[ $cat ] );
1250
+					unset( $icons[$cat] );
1251 1251
 				}
1252 1252
 			}
1253 1253
 			$icon = reset( $icons );
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 
1374 1374
 		foreach ( $item['categories'] as $k => $category ) {
1375 1375
 			if ( in_array( $category, $plans, true ) ) {
1376
-				unset( $item['categories'][ $k ] );
1376
+				unset( $item['categories'][$k] );
1377 1377
 
1378 1378
 				if ( $category === 'Personal' ) {
1379 1379
 					// Show the current package name.
Please login to merge, or discard this patch.
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.