Completed
Pull Request — master (#1415)
by Stephanie
32s
created
deprecated/FrmEDD_SL_Plugin_Updater.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		$this->beta        = ! empty( $this->api_data['beta'] ) ? true : false;
45 45
 		$this->cache_key   = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) );
46 46
 
47
-		$frm_edd_plugin_data[ $this->slug ] = $this->api_data;
47
+		$frm_edd_plugin_data[$this->slug] = $this->api_data;
48 48
 
49 49
 		/**
50 50
 		 * Fires after the $frm_edd_plugin_data is setup.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			$_transient_data = new stdClass();
94 94
 		}
95 95
 
96
-		if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
96
+		if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) {
97 97
 			return $_transient_data;
98 98
 		}
99 99
 
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 					$version_info->plugin = $this->name;
121 121
 				}
122 122
 
123
-				$_transient_data->response[ $this->name ] = $version_info;
123
+				$_transient_data->response[$this->name] = $version_info;
124 124
 
125 125
 			}
126 126
 
127 127
 			$_transient_data->last_checked           = time();
128
-			$_transient_data->checked[ $this->name ] = $this->version;
128
+			$_transient_data->checked[$this->name] = $this->version;
129 129
 
130 130
 		}
131 131
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
190 190
 			$new_sections = array();
191 191
 			foreach ( $_data->sections as $key => $value ) {
192
-				$new_sections[ $key ] = $value;
192
+				$new_sections[$key] = $value;
193 193
 			}
194 194
 
195 195
 			$_data->sections = $new_sections;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
200 200
 			$new_banners = array();
201 201
 			foreach ( $_data->banners as $key => $value ) {
202
-				$new_banners[ $key ] = $value;
202
+				$new_banners[$key] = $value;
203 203
 			}
204 204
 
205 205
 			$_data->banners = $new_banners;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		}
317 317
 
318 318
 		$slug         = sanitize_text_field( $_REQUEST['slug'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
319
-		$data         = $frm_edd_plugin_data[ $slug ];
319
+		$data         = $frm_edd_plugin_data[$slug];
320 320
 		$beta         = ! empty( $data['beta'] ) ? true : false;
321 321
 		$cache_key    = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
322 322
 		$version_info = $this->get_cached_version_info( $cache_key );
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -303,11 +303,13 @@
 block discarded – undo
303 303
 
304 304
 		global $frm_edd_plugin_data;
305 305
 
306
-		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
306
+		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) {
307
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
307 308
 			return;
308 309
 		}
309 310
 
310
-		if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
311
+		if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) {
312
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
311 313
 			return;
312 314
 		}
313 315
 
Please login to merge, or discard this patch.
classes/views/solutions/_import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 				$info['url'] = $xml;
12 12
 			}
13 13
 
14
-			$disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : '';
14
+			$disabled = isset( $imported[$info['form']] ) ? ' disabled' : '';
15 15
 			$url   = isset( $info['url'] ) ? $info['url'] : '';
16 16
 			$value = $importing === 'form' ? $info['form'] : $info['key'];
17 17
 			if ( ! isset( $info['img'] ) ) {
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 				continue;
22 22
 			}
23 23
 
24
-			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) );
24
+			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) );
25 25
 			?>
26 26
 			<div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>">
27 27
 				<?php if ( $importing === 'form' ) { ?>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 					<?php } ?>
42 42
 					/>
43 43
 					<div class="frm_image_option_container frm_label_with_image">
44
-						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) );  // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
44
+						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
45 45
 						<span class="frm_text_label_for_image">
46 46
 							<?php
47 47
 							if ( ! empty( $disabled ) ) {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 							}
55 55
 
56 56
 							if ( $importing === 'form' && $disabled ) {
57
-								echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
57
+								echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
58 58
 							} else {
59 59
 								echo esc_html( $info['name'] );
60 60
 							}
Please login to merge, or discard this patch.
deprecated/FrmDeprecated.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -749,8 +749,8 @@  discard block
 block discarded – undo
749 749
 	 */
750 750
 	public static function get_shortcode_tag( $shortcodes, $short_key, $args ) {
751 751
 		_deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' );
752
-        return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args );
753
-    }
752
+		return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args );
753
+	}
754 754
 
755 755
 	/**
756 756
 	 * @deprecated 3.01
@@ -763,52 +763,52 @@  discard block
 block discarded – undo
763 763
 	/**
764 764
 	 * @deprecated 3.02.03
765 765
 	 */
766
-    public static function jquery_themes() {
766
+	public static function jquery_themes() {
767 767
 		_deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' );
768 768
 
769
-        $themes = array(
770
-            'ui-lightness'  => 'UI Lightness',
771
-            'ui-darkness'   => 'UI Darkness',
772
-            'smoothness'    => 'Smoothness',
773
-            'start'         => 'Start',
774
-            'redmond'       => 'Redmond',
775
-            'sunny'         => 'Sunny',
776
-            'overcast'      => 'Overcast',
777
-            'le-frog'       => 'Le Frog',
778
-            'flick'         => 'Flick',
769
+		$themes = array(
770
+			'ui-lightness'  => 'UI Lightness',
771
+			'ui-darkness'   => 'UI Darkness',
772
+			'smoothness'    => 'Smoothness',
773
+			'start'         => 'Start',
774
+			'redmond'       => 'Redmond',
775
+			'sunny'         => 'Sunny',
776
+			'overcast'      => 'Overcast',
777
+			'le-frog'       => 'Le Frog',
778
+			'flick'         => 'Flick',
779 779
 			'pepper-grinder' => 'Pepper Grinder',
780
-            'eggplant'      => 'Eggplant',
781
-            'dark-hive'     => 'Dark Hive',
782
-            'cupertino'     => 'Cupertino',
783
-            'south-street'  => 'South Street',
784
-            'blitzer'       => 'Blitzer',
785
-            'humanity'      => 'Humanity',
786
-            'hot-sneaks'    => 'Hot Sneaks',
787
-            'excite-bike'   => 'Excite Bike',
788
-            'vader'         => 'Vader',
789
-            'dot-luv'       => 'Dot Luv',
790
-            'mint-choc'     => 'Mint Choc',
791
-            'black-tie'     => 'Black Tie',
792
-            'trontastic'    => 'Trontastic',
793
-            'swanky-purse'  => 'Swanky Purse',
794
-        );
780
+			'eggplant'      => 'Eggplant',
781
+			'dark-hive'     => 'Dark Hive',
782
+			'cupertino'     => 'Cupertino',
783
+			'south-street'  => 'South Street',
784
+			'blitzer'       => 'Blitzer',
785
+			'humanity'      => 'Humanity',
786
+			'hot-sneaks'    => 'Hot Sneaks',
787
+			'excite-bike'   => 'Excite Bike',
788
+			'vader'         => 'Vader',
789
+			'dot-luv'       => 'Dot Luv',
790
+			'mint-choc'     => 'Mint Choc',
791
+			'black-tie'     => 'Black Tie',
792
+			'trontastic'    => 'Trontastic',
793
+			'swanky-purse'  => 'Swanky Purse',
794
+		);
795 795
 
796 796
 		$themes = apply_filters( 'frm_jquery_themes', $themes );
797
-        return $themes;
798
-    }
797
+		return $themes;
798
+	}
799 799
 
800 800
 	/**
801 801
 	 * @deprecated 3.02.03
802 802
 	 */
803
-    public static function enqueue_jquery_css() {
803
+	public static function enqueue_jquery_css() {
804 804
 		_deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' );
805 805
 
806 806
 		$form = self::get_form_for_page();
807 807
 		$theme_css = FrmStylesController::get_style_val( 'theme_css', $form );
808
-        if ( $theme_css != -1 ) {
808
+		if ( $theme_css != -1 ) {
809 809
 			wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() );
810
-        }
811
-    }
810
+		}
811
+	}
812 812
 
813 813
 	/**
814 814
 	 * @deprecated 3.02.03
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 		}
822 822
 
823 823
 		return FrmProStylesController::jquery_css_url( $theme_css );
824
-    }
824
+	}
825 825
 
826 826
 	/**
827 827
 	 * @deprecated 3.02.03
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		FrmAppHelper::permission_check( 'frm_edit_forms' );
28 28
 
29 29
 		$action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
30
-		$action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ];
30
+		$action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[$action];
31 31
 
32 32
 		if ( $action === 'create' ) {
33 33
 			FrmFormsController::update( $values );
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 
37 37
 		$values = FrmFormsHelper::setup_new_vars( $values );
38
-		$id   = FrmForm::create( $values );
38
+		$id = FrmForm::create( $values );
39 39
 		$values['id'] = $id;
40 40
 
41 41
 		FrmFormsController::edit( $values );
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/html-content.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 				'title'     => esc_attr__( 'Toggle Options', 'formidable' ),
17 17
 			)
18 18
 		);
19
-		$e_args  = array(
19
+		$e_args = array(
20 20
 			'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']',
21 21
 			'textarea_rows' => 8,
22 22
 		);
Please login to merge, or discard this patch.
classes/views/frm-forms/landing-page-preview-option.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 $data_keys = array_keys( $data );
7 7
 $params    = array();
8 8
 foreach ( $data_keys as $key ) {
9
-	$params[ 'data-' . $key ] = $data[ $key ];
9
+	$params['data-' . $key] = $data[$key];
10 10
 }
11 11
 $params['class'] = 'frm_show_upgrade frm_noallow';
12 12
 $params['href']  = '#';
Please login to merge, or discard this patch.
classes/models/FrmEntryValidate.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 			return $errors;
15 15
 		}
16 16
 
17
-		if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values[ 'frm_submit_entry_' . $values['form_id'] ] ) || ! wp_verify_nonce( $values[ 'frm_submit_entry_' . $values['form_id'] ], 'frm_submit_entry_nonce' ) ) ) {
17
+		if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values['frm_submit_entry_' . $values['form_id']] ) || ! wp_verify_nonce( $values['frm_submit_entry_' . $values['form_id']], 'frm_submit_entry_nonce' ) ) ) {
18 18
 			$frm_settings   = FrmAppHelper::get_settings();
19 19
 			$errors['form'] = $frm_settings->admin_permission;
20 20
 		}
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 			'key_pointer'     => '', // the pointer in the posted array
89 89
 			'exclude'         => array(), // exclude these field types from validation
90 90
 		);
91
-		$args     = wp_parse_args( $args, $defaults );
91
+		$args = wp_parse_args( $args, $defaults );
92 92
 
93 93
 		if ( empty( $args['parent_field_id'] ) ) {
94
-			$value = isset( $values['item_meta'][ $args['id'] ] ) ? $values['item_meta'][ $args['id'] ] : '';
94
+			$value = isset( $values['item_meta'][$args['id']] ) ? $values['item_meta'][$args['id']] : '';
95 95
 		} else {
96 96
 			// value is from a nested form
97 97
 			$value = $values;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		}
113 113
 
114 114
 		if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) {
115
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
115
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
116 116
 		} elseif ( ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
117 117
 			self::maybe_add_item_name( $value, $posted_field );
118 118
 		}
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 			$pattern = self::phone_format( $field );
189 189
 
190 190
 			if ( ! preg_match( $pattern, $value ) ) {
191
-				$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
191
+				$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
192 192
 			}
193 193
 		}
194 194
 	}
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	 */
299 299
 	private static function form_is_in_progress( $values ) {
300 300
 		return FrmAppHelper::pro_is_installed() &&
301
-			( isset( $values[ 'frm_page_order_' . $values['form_id'] ] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) &&
301
+			( isset( $values['frm_page_order_' . $values['form_id']] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) &&
302 302
 			FrmField::get_all_types_in_form( $values['form_id'], 'break' );
303 303
 	}
304 304
 
@@ -543,9 +543,9 @@  discard block
 block discarded – undo
543 543
 			foreach ( $datas['missing_keys'] as $key_index => $key ) {
544 544
 				$found = self::is_akismet_guest_info_value( $key, $value, $field_id, $datas['name_field_ids'] );
545 545
 				if ( $found ) {
546
-					$datas[ $key ]             = $value;
546
+					$datas[$key]             = $value;
547 547
 					$datas['frm_duplicated'][] = $field_id;
548
-					unset( $datas['missing_keys'][ $key_index ] );
548
+					unset( $datas['missing_keys'][$key_index] );
549 549
 				}
550 550
 			}
551 551
 		}
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 
592 592
 			// Send any potentially useful $_SERVER vars, but avoid sending junk we don't need.
593 593
 			if ( $include_value ) {
594
-				$datas[ $key ] = $value;
594
+				$datas[$key] = $value;
595 595
 			}
596 596
 			unset( $key, $value );
597 597
 		}
@@ -608,10 +608,10 @@  discard block
 block discarded – undo
608 608
 	private static function add_comment_content_to_akismet( &$datas, $values ) {
609 609
 		if ( isset( $datas['frm_duplicated'] ) ) {
610 610
 			foreach ( $datas['frm_duplicated'] as $index ) {
611
-				if ( isset( $values['item_meta'][ $index ] ) ) {
612
-					unset( $values['item_meta'][ $index ] );
611
+				if ( isset( $values['item_meta'][$index] ) ) {
612
+					unset( $values['item_meta'][$index] );
613 613
 				} else {
614
-					unset( $values[ $index ] );
614
+					unset( $values[$index] );
615 615
 				}
616 616
 			}
617 617
 			unset( $datas['frm_duplicated'] );
@@ -632,14 +632,14 @@  discard block
 block discarded – undo
632 632
 	private static function skip_adding_values_to_akismet( &$values ) {
633 633
 		$skipped_fields = self::get_akismet_skipped_field_ids( $values );
634 634
 		foreach ( $skipped_fields as $skipped_field ) {
635
-			if ( ! isset( $values['item_meta'][ $skipped_field->id ] ) ) {
635
+			if ( ! isset( $values['item_meta'][$skipped_field->id] ) ) {
636 636
 				continue;
637 637
 			}
638 638
 
639 639
 			if ( self::should_really_skip_field( $skipped_field, $values ) ) {
640
-				unset( $values['item_meta'][ $skipped_field->id ] );
641
-				if ( isset( $values['item_meta']['other'][ $skipped_field->id ] ) ) {
642
-					unset( $values['item_meta']['other'][ $skipped_field->id ] );
640
+				unset( $values['item_meta'][$skipped_field->id] );
641
+				if ( isset( $values['item_meta']['other'][$skipped_field->id] ) ) {
642
+					unset( $values['item_meta']['other'][$skipped_field->id] );
643 643
 				}
644 644
 			}
645 645
 		}
@@ -672,14 +672,14 @@  discard block
 block discarded – undo
672 672
 		}
673 673
 
674 674
 		// If a choice field has Other option, but Other is not selected.
675
-		if ( empty( $values['item_meta']['other'][ $field_data->id ] ) ) {
675
+		if ( empty( $values['item_meta']['other'][$field_data->id] ) ) {
676 676
 			return true;
677 677
 		}
678 678
 
679 679
 		// Check if submitted value is same as one of field option.
680 680
 		foreach ( $field_data->options as $option ) {
681 681
 			$option_value = ! is_array( $option ) ? $option : ( isset( $option['value'] ) ? $option['value'] : '' );
682
-			if ( $values['item_meta']['other'][ $field_data->id ] === $option_value ) {
682
+			if ( $values['item_meta']['other'][$field_data->id] === $option_value ) {
683 683
 				return true;
684 684
 			}
685 685
 		}
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 
750 750
 			// Convert name array to string.
751 751
 			if ( isset( $value['first'] ) && isset( $value['last'] ) ) {
752
-				$values['item_meta'][ $field_id ] = trim( implode( ' ', $value ) );
752
+				$values['item_meta'][$field_id] = trim( implode( ' ', $value ) );
753 753
 				$values['name_field_ids'][]       = $field_id;
754 754
 				continue;
755 755
 			}
@@ -770,8 +770,8 @@  discard block
 block discarded – undo
770 770
 						continue;
771 771
 					}
772 772
 
773
-					if ( ! isset( $values['item_meta'][ $subsubindex ] ) ) {
774
-						$values['item_meta'][ $subsubindex ] = array();
773
+					if ( ! isset( $values['item_meta'][$subsubindex] ) ) {
774
+						$values['item_meta'][$subsubindex] = array();
775 775
 					}
776 776
 
777 777
 					// Convert name array to string.
@@ -781,11 +781,11 @@  discard block
 block discarded – undo
781 781
 						$values['name_field_ids'][] = $subsubindex;
782 782
 					}
783 783
 
784
-					$values['item_meta'][ $subsubindex ][] = $subsubvalue;
784
+					$values['item_meta'][$subsubindex][] = $subsubvalue;
785 785
 				}
786 786
 			}
787 787
 
788
-			unset( $values['item_meta'][ $field_id ] );
788
+			unset( $values['item_meta'][$field_id] );
789 789
 		}
790 790
 
791 791
 		return $form_ids;
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -113,7 +113,8 @@  discard block
 block discarded – undo
113 113
 
114 114
 		if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) {
115 115
 			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
116
-		} elseif ( ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
116
+		} elseif ( ! isset( $_POST['item_name'] ) ) {
117
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
117 118
 			self::maybe_add_item_name( $value, $posted_field );
118 119
 		}
119 120
 
@@ -655,12 +656,14 @@  discard block
 block discarded – undo
655 656
 	 * @return bool
656 657
 	 */
657 658
 	private static function should_really_skip_field( $field_data, $values ) {
658
-		if ( empty( $field_data->options ) ) { // This is skipped field types.
659
+		if ( empty( $field_data->options ) ) {
660
+// This is skipped field types.
659 661
 			return true;
660 662
 		}
661 663
 
662 664
 		FrmAppHelper::unserialize_or_decode( $field_data->options );
663
-		if ( ! $field_data->options ) { // Check if an error happens when unserializing, or empty options.
665
+		if ( ! $field_data->options ) {
666
+// Check if an error happens when unserializing, or empty options.
664 667
 			return true;
665 668
 		}
666 669
 
@@ -743,7 +746,8 @@  discard block
 block discarded – undo
743 746
 		// Blacklist check for File field in the old version doesn't contain `form_id`.
744 747
 		$form_ids = isset( $values['form_id'] ) ? array( absint( $values['form_id'] ) ) : array();
745 748
 		foreach ( $values['item_meta'] as $field_id => $value ) {
746
-			if ( ! is_numeric( $field_id ) ) { // Maybe `other`.
749
+			if ( ! is_numeric( $field_id ) ) {
750
+// Maybe `other`.
747 751
 				continue;
748 752
 			}
749 753
 
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
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 	 * @param array $atts
46 46
 	 */
47 47
 	private function _set( $param, $atts ) {
48
-		if ( isset( $atts[ $param ] ) ) {
49
-			$this->{$param} = $atts[ $param ];
48
+		if ( isset( $atts[$param] ) ) {
49
+			$this->{$param} = $atts[$param];
50 50
 		}
51 51
 	}
52 52
 
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 
91 91
 		$exclude = array( 'field_obj', 'html' );
92 92
 		foreach ( $exclude as $ex ) {
93
-			if ( isset( $atts[ $ex ] ) ) {
94
-				unset( $this->pass_args[ $ex ] );
93
+			if ( isset( $atts[$ex] ) ) {
94
+				unset( $this->pass_args[$ex] );
95 95
 			}
96 96
 		}
97 97
 	}
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 	 * @param array $set
104 104
 	 */
105 105
 	private function set_from_field( $atts, $set ) {
106
-		if ( isset( $atts[ $set['param'] ] ) ) {
107
-			$this->{$set['param']} = $atts[ $set['param'] ];
106
+		if ( isset( $atts[$set['param']] ) ) {
107
+			$this->{$set['param']} = $atts[$set['param']];
108 108
 		} else {
109 109
 			$this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] );
110 110
 		}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	private function replace_error_shortcode() {
231 231
 		$this->maybe_add_error_id();
232
-		$error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false;
232
+		$error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false;
233 233
 
234 234
 		if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) {
235 235
 			$error_body = self::get_error_body( $this->html );
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	 * @since 3.06.02
271 271
 	 */
272 272
 	private function maybe_add_error_id() {
273
-		if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
273
+		if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
274 274
 			return;
275 275
 		}
276 276
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER );
351 351
 
352 352
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
353
-			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
353
+			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
354 354
 			$tag            = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
355 355
 
356 356
 			$replace_with = '';
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 				$replace_with = $this->replace_input_shortcode( $shortcode_atts );
362 362
 			}
363 363
 
364
-			$this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html );
364
+			$this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html );
365 365
 		}
366 366
 	}
367 367
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 			unset( $shortcode_atts['class'] );
394 394
 		}
395 395
 
396
-		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false';
396
+		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? 'true' : 'false';
397 397
 
398 398
 		$this->field_obj->set_field_column( 'shortcodes', $shortcode_atts );
399 399
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 	 */
449 449
 	private function get_field_div_classes() {
450 450
 		// Add error class
451
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
451
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
452 452
 
453 453
 		// Add label position class
454 454
 		$settings = $this->field_obj->display_field_settings();
Please login to merge, or discard this patch.
classes/helpers/FrmXMLHelper.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,8 @@
 block discarded – undo
87 87
 
88 88
 		if ( ! isset( $imported['form_status'] ) || empty( $imported['form_status'] ) ) {
89 89
 			// Check for an error message in the XML.
90
-			if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions
90
+			if ( isset( $xml->Code ) && isset( $xml->Message ) ) {
91
+// phpcs:ignore WordPress.NamingConventions
91 92
 				$imported['error'] = (string) $xml->Message; // phpcs:ignore WordPress.NamingConventions
92 93
 			}
93 94
 		}
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
 			if ( $term && is_array( $term ) ) {
179 179
 				$imported['imported']['terms'] ++;
180
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
180
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
181 181
 			}
182 182
 
183 183
 			unset( $term, $t );
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 					}
234 234
 
235 235
 					// Keep track of whether this specific form was updated or not.
236
-					$imported['form_status'][ $form_id ] = 'imported';
236
+					$imported['form_status'][$form_id] = 'imported';
237 237
 				}
238 238
 			}
239 239
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 			// Update field ids/keys to new ones.
249 249
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
250 250
 
251
-			$imported['forms'][ (int) $item->id ] = $form_id;
251
+			$imported['forms'][(int) $item->id] = $form_id;
252 252
 
253 253
 			// Send pre 2.0 form options through function that creates actions.
254 254
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -322,15 +322,15 @@  discard block
 block discarded – undo
322 322
 		}
323 323
 
324 324
 		// Keep track of whether this specific form was updated or not
325
-		$imported['form_status'][ $form_id ] = 'updated';
325
+		$imported['form_status'][$form_id] = 'updated';
326 326
 	}
327 327
 
328 328
 	private static function get_form_fields( $form_id ) {
329 329
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
330 330
 		$old_fields  = array();
331 331
 		foreach ( $form_fields as $f ) {
332
-			$old_fields[ $f->id ]        = $f;
333
-			$old_fields[ $f->field_key ] = $f->id;
332
+			$old_fields[$f->id]        = $f;
333
+			$old_fields[$f->field_key] = $f->id;
334 334
 			unset( $f );
335 335
 		}
336 336
 		$form_fields = $old_fields;
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 	 */
388 388
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
389 389
 		if ( $parent_form_id ) {
390
-			$child_forms[ $form_id ] = $parent_form_id;
390
+			$child_forms[$form_id] = $parent_form_id;
391 391
 		}
392 392
 	}
393 393
 
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
 	 */
403 403
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
404 404
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
405
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) {
405
+			if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) {
406 406
 				// Update all children with this old parent_form_id
407
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
407
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
408 408
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
409 409
 				do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id );
410 410
 			}
@@ -434,27 +434,27 @@  discard block
 block discarded – undo
434 434
 
435 435
 			if ( ! empty( $this_form ) ) {
436 436
 				// check for field to edit by field id
437
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
437
+				if ( isset( $form_fields[$f['id']] ) ) {
438 438
 					FrmField::update( $f['id'], $f );
439 439
 					$imported['updated']['fields'] ++;
440 440
 
441
-					unset( $form_fields[ $f['id'] ] );
441
+					unset( $form_fields[$f['id']] );
442 442
 
443 443
 					// Unset old field key.
444
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
445
-						unset( $form_fields[ $f['field_key'] ] );
444
+					if ( isset( $form_fields[$f['field_key']] ) ) {
445
+						unset( $form_fields[$f['field_key']] );
446 446
 					}
447
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
448
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
447
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
448
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
449 449
 
450 450
 					// check for field to edit by field key
451 451
 					unset( $f['id'] );
452 452
 
453
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
453
+					FrmField::update( $form_fields[$f['field_key']], $f );
454 454
 					$imported['updated']['fields'] ++;
455 455
 
456
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] ); // Unset old field id.
457
-					unset( $form_fields[ $f['field_key'] ] ); // Unset old field key.
456
+					unset( $form_fields[$form_fields[$f['field_key']]] ); // Unset old field id.
457
+					unset( $form_fields[$f['field_key']] ); // Unset old field key.
458 458
 				} else {
459 459
 					// If no matching field id or key in this form, create the field.
460 460
 					self::create_imported_field( $f, $imported );
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
 		if ( $f['type'] == 'form' || ( $f['type'] == 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
564 564
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
565 565
 				$form_select = (int) $f['field_options']['form_select'];
566
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
567
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
566
+				if ( isset( $imported['forms'][$form_select] ) ) {
567
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
568 568
 				}
569 569
 			}
570 570
 		}
@@ -585,8 +585,8 @@  discard block
 block discarded – undo
585 585
 
586 586
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
587 587
 			$old_form = $f['field_options']['get_values_form'];
588
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
589
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
588
+			if ( isset( $imported['forms'][$old_form] ) ) {
589
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
590 590
 			}
591 591
 		}
592 592
 	}
@@ -607,12 +607,12 @@  discard block
 block discarded – undo
607 607
 	private static function migrate_placeholders( &$f ) {
608 608
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
609 609
 		foreach ( $update_values as $k => $v ) {
610
-			$f[ $k ] = $v;
610
+			$f[$k] = $v;
611 611
 		}
612 612
 
613 613
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
614 614
 		foreach ( $update_values as $k => $v ) {
615
-			$f[ $k ] = $v;
615
+			$f[$k] = $v;
616 616
 		}
617 617
 	}
618 618
 
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 	public static function migrate_field_placeholder( $field, $type ) {
627 627
 		$field = (array) $field;
628 628
 		$field_options = $field['field_options'];
629
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
629
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
630 630
 			return array();
631 631
 		}
632 632
 
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 				}
653 653
 
654 654
 				if ( $opt == $default_value ) {
655
-					unset( $options[ $opt_key ] );
655
+					unset( $options[$opt_key] );
656 656
 					break;
657 657
 				}
658 658
 			}
@@ -707,10 +707,10 @@  discard block
 block discarded – undo
707 707
 			$field_object->type = 'file'; // Fake the file type as FrmProImport::import_attachment checks for file type.
708 708
 
709 709
 			$image_id = FrmProFileImport::import_attachment( $option['src'], $field_object );
710
-			unset( $field['options'][ $key ]['src'] ); // Remove the src from options as it isn't required after import.
710
+			unset( $field['options'][$key]['src'] ); // Remove the src from options as it isn't required after import.
711 711
 
712 712
 			if ( is_numeric( $image_id ) ) {
713
-				$field['options'][ $key ]['image'] = $image_id;
713
+				$field['options'][$key]['image'] = $image_id;
714 714
 			}
715 715
 		}
716 716
 
@@ -878,8 +878,8 @@  discard block
 block discarded – undo
878 878
 			} else {
879 879
 				if ( $post['post_type'] === 'frm_display' ) {
880 880
 					$post['post_content'] = self::maybe_prepare_json_view_content( $post['post_content'] );
881
-				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][ $post['post_parent'] ] ) ) {
882
-					$post['post_parent'] = $imported['posts'][ $post['post_parent'] ];
881
+				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][$post['post_parent']] ) ) {
882
+					$post['post_parent'] = $imported['posts'][$post['post_parent']];
883 883
 				}
884 884
 				// Create/update post now
885 885
 				$post_id = wp_insert_post( $post );
@@ -890,27 +890,27 @@  discard block
 block discarded – undo
890 890
 			}
891 891
 
892 892
 			if ( false !== strpos( $post['post_content'], '[display-frm-data' ) || false !== strpos( $post['post_content'], '[formidable' ) ) {
893
-				$posts_with_shortcodes[ $post_id ] = $post;
893
+				$posts_with_shortcodes[$post_id] = $post;
894 894
 			}
895 895
 
896 896
 			self::update_postmeta( $post, $post_id );
897 897
 			self::update_layout( $post, $post_id );
898 898
 
899 899
 			$this_type = 'posts';
900
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
901
-				$this_type = $post_types[ $post['post_type'] ];
900
+			if ( isset( $post_types[$post['post_type']] ) ) {
901
+				$this_type = $post_types[$post['post_type']];
902 902
 			}
903 903
 
904 904
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
905
-				$imported['updated'][ $this_type ] ++;
905
+				$imported['updated'][$this_type] ++;
906 906
 			} else {
907
-				$imported['imported'][ $this_type ] ++;
907
+				$imported['imported'][$this_type] ++;
908 908
 			}
909 909
 
910
-			$imported['posts'][ (int) $old_id ] = $post_id;
910
+			$imported['posts'][(int) $old_id] = $post_id;
911 911
 
912 912
 			if ( $post['post_type'] === 'frm_display' ) {
913
-				$view_ids[ (int) $old_id ] = $post_id;
913
+				$view_ids[(int) $old_id] = $post_id;
914 914
 			}
915 915
 
916 916
 			do_action( 'frm_after_import_view', $post_id, $post );
@@ -1071,9 +1071,9 @@  discard block
 block discarded – undo
1071 1071
 			$post['attachment_url'] = (string) $item->attachment_url;
1072 1072
 		}
1073 1073
 
1074
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
1074
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
1075 1075
 			// update to new form id
1076
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
1076
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
1077 1077
 		}
1078 1078
 
1079 1079
 		// Don't allow default styles to take over a site's default style
@@ -1110,8 +1110,8 @@  discard block
 block discarded – undo
1110 1110
 		);
1111 1111
 
1112 1112
 		// Switch old form and field ids to new ones.
1113
-		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
1114
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
1113
+		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) {
1114
+			$m['value'] = $imported['forms'][(int) $m['value']];
1115 1115
 		} else {
1116 1116
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1117 1117
 
@@ -1122,15 +1122,15 @@  discard block
 block discarded – undo
1122 1122
 				} elseif ( 'frm_options' === $m['key'] ) {
1123 1123
 
1124 1124
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
1125
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
1126
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
1125
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
1126
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
1127 1127
 						}
1128 1128
 					}
1129 1129
 
1130 1130
 					$check_dup_array = array();
1131 1131
 					if ( isset( $m['value']['order_by'] ) && ! empty( $m['value']['order_by'] ) ) {
1132
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
1133
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
1132
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
1133
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
1134 1134
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
1135 1135
 							$check_dup_array[] = 'order_by';
1136 1136
 						}
@@ -1141,9 +1141,9 @@  discard block
 block discarded – undo
1141 1141
 					}
1142 1142
 
1143 1143
 					foreach ( $check_dup_array as $check_k ) {
1144
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
1145
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
1146
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
1144
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
1145
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
1146
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
1147 1147
 							}
1148 1148
 							unset( $mk, $mv );
1149 1149
 						}
@@ -1156,11 +1156,11 @@  discard block
 block discarded – undo
1156 1156
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1157 1157
 		}
1158 1158
 
1159
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
1159
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
1160 1160
 	}
1161 1161
 
1162 1162
 	private static function populate_layout( &$post, $layout ) {
1163
-		$post['layout'][ (string) $layout->type ] = (string) $layout->data;
1163
+		$post['layout'][(string) $layout->type] = (string) $layout->data;
1164 1164
 	}
1165 1165
 
1166 1166
 	/**
@@ -1188,11 +1188,11 @@  discard block
 block discarded – undo
1188 1188
 				$name = (string) $c;
1189 1189
 			}
1190 1190
 
1191
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
1192
-				$post['tax_input'][ $taxonomy ] = array();
1191
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
1192
+				$post['tax_input'][$taxonomy] = array();
1193 1193
 			}
1194 1194
 
1195
-			$post['tax_input'][ $taxonomy ][] = $name;
1195
+			$post['tax_input'][$taxonomy][] = $name;
1196 1196
 			unset( $name );
1197 1197
 		}
1198 1198
 	}
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
 
1332 1332
 		$message = '<ul>';
1333 1333
 		foreach ( $result as $type => $results ) {
1334
-			if ( ! isset( $t_strings[ $type ] ) ) {
1334
+			if ( ! isset( $t_strings[$type] ) ) {
1335 1335
 				// only print imported and updated
1336 1336
 				continue;
1337 1337
 			}
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
 			}
1344 1344
 
1345 1345
 			if ( ! empty( $s_message ) ) {
1346
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1346
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1347 1347
 				$message .= implode( ', ', $s_message );
1348 1348
 				$message .= '</li>';
1349 1349
 			}
@@ -1395,8 +1395,8 @@  discard block
 block discarded – undo
1395 1395
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1396 1396
 		);
1397 1397
 
1398
-		if ( isset( $strings[ $type ] ) ) {
1399
-			$s_message[] = $strings[ $type ];
1398
+		if ( isset( $strings[$type] ) ) {
1399
+			$s_message[] = $strings[$type];
1400 1400
 		} else {
1401 1401
 			$string = ' ' . $m . ' ' . ucfirst( $type );
1402 1402
 
@@ -1544,7 +1544,7 @@  discard block
 block discarded – undo
1544 1544
 
1545 1545
 		foreach ( $options as $key => $option ) {
1546 1546
 			if ( is_array( $option ) && ! empty( $option['image'] ) ) {
1547
-				$options[ $key ]['src'] = wp_get_attachment_url( $option['image'] );
1547
+				$options[$key]['src'] = wp_get_attachment_url( $option['image'] );
1548 1548
 				$updated                = true;
1549 1549
 			}
1550 1550
 		}
@@ -1573,8 +1573,8 @@  discard block
 block discarded – undo
1573 1573
 	 */
1574 1574
 	private static function remove_defaults( $defaults, &$saved ) {
1575 1575
 		foreach ( $saved as $key => $value ) {
1576
-			if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) {
1577
-				unset( $saved[ $key ] );
1576
+			if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) {
1577
+				unset( $saved[$key] );
1578 1578
 			}
1579 1579
 		}
1580 1580
 	}
@@ -1585,14 +1585,14 @@  discard block
 block discarded – undo
1585 1585
 	 * @since 3.06
1586 1586
 	 */
1587 1587
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1588
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1588
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1589 1589
 			return;
1590 1590
 		}
1591 1591
 
1592
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1593
-		$default_html = $defaults[ $html_name ];
1592
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1593
+		$default_html = $defaults[$html_name];
1594 1594
 		if ( $old_html == $default_html ) {
1595
-			unset( $options[ $html_name ] );
1595
+			unset( $options[$html_name] );
1596 1596
 
1597 1597
 			return;
1598 1598
 		}
@@ -1600,7 +1600,7 @@  discard block
 block discarded – undo
1600 1600
 		// Account for some of the older field default HTML.
1601 1601
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1602 1602
 		if ( $old_html == $default_html ) {
1603
-			unset( $options[ $html_name ] );
1603
+			unset( $options[$html_name] );
1604 1604
 		}
1605 1605
 	}
1606 1606
 
@@ -1691,8 +1691,8 @@  discard block
 block discarded – undo
1691 1691
 		);
1692 1692
 
1693 1693
 		foreach ( $post_settings as $post_setting ) {
1694
-			if ( isset( $form_options[ $post_setting ] ) ) {
1695
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1694
+			if ( isset( $form_options[$post_setting] ) ) {
1695
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1696 1696
 			}
1697 1697
 			unset( $post_setting );
1698 1698
 		}
@@ -1763,11 +1763,11 @@  discard block
 block discarded – undo
1763 1763
 		foreach ( $post_content as $key => $setting ) {
1764 1764
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
1765 1765
 				// Replace old IDs with new IDs
1766
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
1766
+				$post_content[$key] = str_replace( $old, $new, $setting );
1767 1767
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
1768 1768
 				foreach ( $setting as $k => $val ) {
1769 1769
 					// Replace old IDs with new IDs
1770
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
1770
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
1771 1771
 				}
1772 1772
 			}
1773 1773
 			unset( $key, $setting );
@@ -1843,8 +1843,8 @@  discard block
 block discarded – undo
1843 1843
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
1844 1844
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
1845 1845
 		foreach ( $delete_settings as $index ) {
1846
-			if ( isset( $form_options[ $index ] ) ) {
1847
-				unset( $form_options[ $index ] );
1846
+			if ( isset( $form_options[$index] ) ) {
1847
+				unset( $form_options[$index] );
1848 1848
 			}
1849 1849
 		}
1850 1850
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -1897,12 +1897,12 @@  discard block
 block discarded – undo
1897 1897
 			'reply_to_name' => '',
1898 1898
 		);
1899 1899
 		foreach ( $reply_fields as $f => $val ) {
1900
-			if ( isset( $notification[ $f ] ) ) {
1901
-				$atts[ $f ] = $notification[ $f ];
1902
-				if ( 'custom' == $notification[ $f ] ) {
1903
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
1904
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
1905
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
1900
+			if ( isset( $notification[$f] ) ) {
1901
+				$atts[$f] = $notification[$f];
1902
+				if ( 'custom' == $notification[$f] ) {
1903
+					$atts[$f] = $notification['cust_' . $f];
1904
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
1905
+					$atts[$f] = '[' . $atts[$f] . ']';
1906 1906
 				}
1907 1907
 			}
1908 1908
 			unset( $f, $val );
@@ -1933,13 +1933,13 @@  discard block
 block discarded – undo
1933 1933
 		foreach ( $atts['email_to'] as $key => $email_field ) {
1934 1934
 
1935 1935
 			if ( is_numeric( $email_field ) ) {
1936
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
1936
+				$atts['email_to'][$key] = '[' . $email_field . ']';
1937 1937
 			}
1938 1938
 
1939 1939
 			if ( strpos( $email_field, '|' ) ) {
1940 1940
 				$email_opt = explode( '|', $email_field );
1941 1941
 				if ( isset( $email_opt[0] ) ) {
1942
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1942
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1943 1943
 				}
1944 1944
 				unset( $email_opt );
1945 1945
 			}
@@ -1960,12 +1960,12 @@  discard block
 block discarded – undo
1960 1960
 		// Add more fields to the new notification
1961 1961
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
1962 1962
 		foreach ( $add_fields as $add_field ) {
1963
-			if ( isset( $notification[ $add_field ] ) ) {
1964
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
1963
+			if ( isset( $notification[$add_field] ) ) {
1964
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
1965 1965
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
1966
-				$new_notification['post_content'][ $add_field ] = 0;
1966
+				$new_notification['post_content'][$add_field] = 0;
1967 1967
 			} else {
1968
-				$new_notification['post_content'][ $add_field ] = '';
1968
+				$new_notification['post_content'][$add_field] = '';
1969 1969
 			}
1970 1970
 			unset( $add_field );
1971 1971
 		}
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
1990 1990
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
1991 1991
 				if ( is_numeric( $email_key ) ) {
1992
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1992
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1993 1993
 				}
1994 1994
 				unset( $email_key, $val );
1995 1995
 			}
Please login to merge, or discard this patch.
classes/views/xml/xml.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 
19 19
 foreach ( $type as $tb_type ) {
20 20
 
21
-	if ( ! isset( $tables[ $tb_type ] ) ) {
21
+	if ( ! isset( $tables[$tb_type] ) ) {
22 22
 		do_action( 'frm_xml_import_' . $tb_type, $args );
23 23
 		continue;
24 24
 	}
25 25
 
26
-	if ( ! isset( $records[ $tb_type ] ) ) {
26
+	if ( ! isset( $records[$tb_type] ) ) {
27 27
 		// No records.
28 28
 		continue;
29 29
 	}
30 30
 
31
-	$item_ids = $records[ $tb_type ];
31
+	$item_ids = $records[$tb_type];
32 32
 
33 33
 	if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) {
34 34
 		include dirname( __FILE__ ) . '/posts_xml.php';
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		include FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php';
39 39
 	}
40 40
 
41
-	unset( $item_ids, $records[ $tb_type ], $tb_type );
41
+	unset( $item_ids, $records[$tb_type], $tb_type );
42 42
 }
43 43
 
44 44
 /**
Please login to merge, or discard this patch.