Completed
Push — master ( ccdf5d...7f4454 )
by Stephanie
03:00
created
classes/helpers/FrmXMLHelper.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 			);
116 116
 
117 117
 			if ( $term && is_array( $term ) ) {
118
-                $imported['imported']['terms']++;
119
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
118
+                $imported['imported']['terms'] ++;
119
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
120 120
             }
121 121
 
122 122
 			unset( $term, $t );
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 			} else {
166 166
 				$form_id = FrmForm::create( $form );
167 167
 		        if ( $form_id ) {
168
-		            $imported['imported']['forms']++;
168
+		            $imported['imported']['forms'] ++;
169 169
 		            // Keep track of whether this specific form was updated or not
170
-					$imported['form_status'][ $form_id ] = 'imported';
170
+					$imported['form_status'][$form_id] = 'imported';
171 171
 					self::track_imported_child_forms( (int) $form_id, $form['parent_form_id'], $child_forms );
172 172
 		        }
173 173
 			}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		    // Update field ids/keys to new ones
180 180
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
181 181
 
182
-			$imported['forms'][ (int) $item->id ] = $form_id;
182
+			$imported['forms'][(int) $item->id] = $form_id;
183 183
 
184 184
             // Send pre 2.0 form options through function that creates actions
185 185
             self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -230,17 +230,17 @@  discard block
 block discarded – undo
230 230
 	private static function update_form( $this_form, $form, &$imported ) {
231 231
 		$form_id = $this_form->id;
232 232
 		FrmForm::update( $form_id, $form );
233
-		$imported['updated']['forms']++;
233
+		$imported['updated']['forms'] ++;
234 234
 		// Keep track of whether this specific form was updated or not
235
-		$imported['form_status'][ $form_id ] = 'updated';
235
+		$imported['form_status'][$form_id] = 'updated';
236 236
 	}
237 237
 
238 238
 	private static function get_form_fields( $form_id ) {
239 239
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
240 240
 		$old_fields = array();
241 241
 		foreach ( $form_fields as $f ) {
242
-			$old_fields[ $f->id ] = $f;
243
-			$old_fields[ $f->field_key ] = $f->id;
242
+			$old_fields[$f->id] = $f;
243
+			$old_fields[$f->field_key] = $f->id;
244 244
 			unset( $f );
245 245
 		}
246 246
 		$form_fields = $old_fields;
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 	*/
295 295
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
296 296
 		if ( $parent_form_id ) {
297
-			$child_forms[ $form_id ] = $parent_form_id;
297
+			$child_forms[$form_id] = $parent_form_id;
298 298
 		}
299 299
 	}
300 300
 
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
310 310
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
311 311
 
312
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && $imported_forms[ $old_parent_form_id ] != $old_parent_form_id ) {
312
+			if ( isset( $imported_forms[$old_parent_form_id] ) && $imported_forms[$old_parent_form_id] != $old_parent_form_id ) {
313 313
 				// Update all children with this old parent_form_id
314
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
314
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
315 315
 
316 316
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
317 317
 			}
@@ -346,25 +346,25 @@  discard block
 block discarded – undo
346 346
 
347 347
 			if ( ! empty( $this_form ) ) {
348 348
 				// check for field to edit by field id
349
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
349
+				if ( isset( $form_fields[$f['id']] ) ) {
350 350
 					FrmField::update( $f['id'], $f );
351
-					$imported['updated']['fields']++;
351
+					$imported['updated']['fields'] ++;
352 352
 
353
-					unset( $form_fields[ $f['id'] ] );
353
+					unset( $form_fields[$f['id']] );
354 354
 
355 355
 					//unset old field key
356
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
357
-						unset( $form_fields[ $f['field_key'] ] );
356
+					if ( isset( $form_fields[$f['field_key']] ) ) {
357
+						unset( $form_fields[$f['field_key']] );
358 358
 					}
359
-				} else if ( isset( $form_fields[ $f['field_key'] ] ) ) {
359
+				} else if ( isset( $form_fields[$f['field_key']] ) ) {
360 360
 					// check for field to edit by field key
361 361
 					unset( $f['id'] );
362 362
 
363
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
364
-					$imported['updated']['fields']++;
363
+					FrmField::update( $form_fields[$f['field_key']], $f );
364
+					$imported['updated']['fields'] ++;
365 365
 
366
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] ); //unset old field id
367
-					unset( $form_fields[ $f['field_key'] ] ); //unset old field key
366
+					unset( $form_fields[$form_fields[$f['field_key']]] ); //unset old field id
367
+					unset( $form_fields[$f['field_key']] ); //unset old field key
368 368
 				} else {
369 369
 					// if no matching field id or key in this form, create the field
370 370
 					self::create_imported_field( $f, $imported );
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 		if ( $f['type'] == 'form' || ( $f['type'] == 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
432 432
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
433 433
 				$form_select = (int) $f['field_options']['form_select'];
434
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
435
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
434
+				if ( isset( $imported['forms'][$form_select] ) ) {
435
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
436 436
 				}
437 437
 			}
438 438
 		}
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
 
453 453
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
454 454
 			$old_form = $f['field_options']['get_values_form'];
455
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
456
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
455
+			if ( isset( $imported['forms'][$old_form] ) ) {
456
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
457 457
 			}
458 458
 		}
459 459
 	}
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 
472 472
 		$new_id = FrmField::create( $f );
473 473
 		if ( $new_id != false ) {
474
-			$imported['imported']['fields']++;
474
+			$imported['imported']['fields'] ++;
475 475
 			do_action( 'frm_after_field_is_imported', $f, $new_id );
476 476
 		}
477 477
 	}
@@ -601,17 +601,17 @@  discard block
 block discarded – undo
601 601
 			self::update_postmeta( $post, $post_id );
602 602
 
603 603
             $this_type = 'posts';
604
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
605
-				$this_type = $post_types[ $post['post_type'] ];
604
+			if ( isset( $post_types[$post['post_type']] ) ) {
605
+				$this_type = $post_types[$post['post_type']];
606 606
             }
607 607
 
608 608
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
609
-                $imported['updated'][ $this_type ]++;
609
+                $imported['updated'][$this_type] ++;
610 610
             } else {
611
-                $imported['imported'][ $this_type ]++;
611
+                $imported['imported'][$this_type] ++;
612 612
             }
613 613
 
614
-			$imported['posts'][ (int) $old_id ] = $post_id;
614
+			$imported['posts'][(int) $old_id] = $post_id;
615 615
 
616 616
 			do_action( 'frm_after_import_view', $post_id, $post );
617 617
 
@@ -628,9 +628,9 @@  discard block
 block discarded – undo
628 628
 			$post['attachment_url'] = (string) $item->attachment_url;
629 629
 		}
630 630
 
631
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
631
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
632 632
 		    // update to new form id
633
-		    $post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
633
+		    $post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
634 634
 		}
635 635
 
636 636
 		// Don't allow default styles to take over a site's default style
@@ -657,8 +657,8 @@  discard block
 block discarded – undo
657 657
 		);
658 658
 
659 659
 		//switch old form and field ids to new ones
660
-		if ( $m['key'] == 'frm_form_id' && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
661
-		    $m['value'] = $imported['forms'][ (int) $m['value'] ];
660
+		if ( $m['key'] == 'frm_form_id' && isset( $imported['forms'][(int) $m['value']] ) ) {
661
+		    $m['value'] = $imported['forms'][(int) $m['value']];
662 662
 		} else {
663 663
 		    $m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
664 664
 
@@ -669,15 +669,15 @@  discard block
 block discarded – undo
669 669
     		    } else if ( $m['key'] == 'frm_options' ) {
670 670
 
671 671
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
672
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
673
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
672
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
673
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
674 674
     		            }
675 675
     		        }
676 676
 
677 677
                     $check_dup_array = array();
678 678
     		        if ( isset( $m['value']['order_by'] ) && ! empty( $m['value']['order_by'] ) ) {
679
-    		            if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
680
-    		                $m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
679
+    		            if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
680
+    		                $m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
681 681
     		            } else if ( is_array( $m['value']['order_by'] ) ) {
682 682
                             $check_dup_array[] = 'order_by';
683 683
     		            }
@@ -688,9 +688,9 @@  discard block
 block discarded – undo
688 688
     		        }
689 689
 
690 690
                     foreach ( $check_dup_array as $check_k ) {
691
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
692
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
693
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
691
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
692
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
693
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
694 694
 		                    }
695 695
 							unset( $mk, $mv );
696 696
 		                }
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
704 704
 		}
705 705
 
706
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
706
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
707 707
     }
708 708
 
709 709
     /**
@@ -731,11 +731,11 @@  discard block
 block discarded – undo
731 731
 		        $name = (string) $c;
732 732
 		    }
733 733
 
734
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
735
-				$post['tax_input'][ $taxonomy ] = array();
734
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
735
+				$post['tax_input'][$taxonomy] = array();
736 736
 			}
737 737
 
738
-			$post['tax_input'][ $taxonomy ][] = $name;
738
+			$post['tax_input'][$taxonomy][] = $name;
739 739
 			unset( $name );
740 740
 		}
741 741
     }
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 
834 834
         $message = '<ul>';
835 835
         foreach ( $result as $type => $results ) {
836
-			if ( ! isset( $t_strings[ $type ] ) ) {
836
+			if ( ! isset( $t_strings[$type] ) ) {
837 837
                 // only print imported and updated
838 838
                 continue;
839 839
             }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 			}
846 846
 
847 847
 			if ( ! empty( $s_message ) ) {
848
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
848
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
849 849
 				$message .= implode( ', ', $s_message );
850 850
 				$message .= '</li>';
851 851
 			}
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
             'actions'   => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
876 876
         );
877 877
 
878
-		$s_message[] = isset( $strings[ $type ] ) ? $strings[ $type ] : ' ' . $m . ' ' . ucfirst( $type );
878
+		$s_message[] = isset( $strings[$type] ) ? $strings[$type] : ' ' . $m . ' ' . ucfirst( $type );
879 879
     }
880 880
 
881 881
 	/**
@@ -972,10 +972,10 @@  discard block
 block discarded – undo
972 972
 		$array_defaults = array_filter( $defaults, 'is_array' );
973 973
 		foreach ( $array_defaults as $d => $default ) {
974 974
 			// compare array defaults
975
-			if ( $default == $saved[ $d ] ) {
976
-				unset( $saved[ $d ] );
975
+			if ( $default == $saved[$d] ) {
976
+				unset( $saved[$d] );
977 977
 			}
978
-			unset( $defaults[ $d ] );
978
+			unset( $defaults[$d] );
979 979
 		}
980 980
  		$saved = array_diff_assoc( (array) $saved, $defaults );
981 981
 	}
@@ -986,21 +986,21 @@  discard block
 block discarded – undo
986 986
 	 * @since 3.06
987 987
 	 */
988 988
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
989
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
989
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
990 990
 			return;
991 991
 		}
992 992
 
993
-		$old_html = str_replace( "\r\n", "\n", $options[ $html_name ] );
994
-		$default_html = $defaults[ $html_name ];
993
+		$old_html = str_replace( "\r\n", "\n", $options[$html_name] );
994
+		$default_html = $defaults[$html_name];
995 995
 		if ( $old_html == $default_html ) {
996
-			unset( $options[ $html_name ] );
996
+			unset( $options[$html_name] );
997 997
 			return;
998 998
 		}
999 999
 
1000 1000
 		// Account for some of the older field default HTML.
1001 1001
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1002 1002
 		if ( $old_html == $default_html ) {
1003
-			unset( $options[ $html_name ] );
1003
+			unset( $options[$html_name] );
1004 1004
 		}
1005 1005
 	}
1006 1006
 
@@ -1074,8 +1074,8 @@  discard block
 block discarded – undo
1074 1074
 		$post_settings = array( 'post_type', 'post_category', 'post_content', 'post_excerpt', 'post_title', 'post_name', 'post_date', 'post_status', 'post_custom_fields', 'post_password' );
1075 1075
 
1076 1076
         foreach ( $post_settings as $post_setting ) {
1077
-			if ( isset( $form_options[ $post_setting ] ) ) {
1078
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1077
+			if ( isset( $form_options[$post_setting] ) ) {
1078
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1079 1079
             }
1080 1080
 			unset( $post_setting );
1081 1081
         }
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
         if ( ! $exists ) {
1106 1106
 			// this isn't an email, but we need to use a class that will always be included
1107 1107
 			FrmDb::save_json_post( $new_action );
1108
-            $imported['imported']['actions']++;
1108
+            $imported['imported']['actions'] ++;
1109 1109
         }
1110 1110
     }
1111 1111
 
@@ -1137,11 +1137,11 @@  discard block
 block discarded – undo
1137 1137
         foreach ( $post_content as $key => $setting ) {
1138 1138
             if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
1139 1139
                 // Replace old IDs with new IDs
1140
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
1140
+				$post_content[$key] = str_replace( $old, $new, $setting );
1141 1141
             } else if ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
1142 1142
                 foreach ( $setting as $k => $val ) {
1143 1143
                     // Replace old IDs with new IDs
1144
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
1144
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
1145 1145
                 }
1146 1146
             }
1147 1147
             unset( $key, $setting );
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
         foreach ( $notifications as $new_notification ) {
1172 1172
             $new_notification['post_type']      = $post_type;
1173 1173
             $new_notification['post_excerpt']   = 'email';
1174
-			$new_notification['post_title']     = __( 'Email Notification', 'formidable' );
1174
+			$new_notification['post_title'] = __( 'Email Notification', 'formidable' );
1175 1175
             $new_notification['menu_order']     = $form_id;
1176 1176
             $new_notification['post_status']    = 'publish';
1177 1177
 
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 				// Switch all other field IDs in email
1185 1185
                 $new_notification['post_content'] = FrmFieldsHelper::switch_field_ids( $new_notification['post_content'] );
1186 1186
             }
1187
-            $new_notification['post_content']   = FrmAppHelper::prepare_and_encode( $new_notification['post_content'] );
1187
+            $new_notification['post_content'] = FrmAppHelper::prepare_and_encode( $new_notification['post_content'] );
1188 1188
 
1189 1189
 			$exists = get_posts(
1190 1190
 				array(
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 
1198 1198
 			if ( empty( $exists ) ) {
1199 1199
 				FrmDb::save_json_post( $new_notification );
1200
-                $imported['imported']['actions']++;
1200
+                $imported['imported']['actions'] ++;
1201 1201
             }
1202 1202
 			unset( $new_notification );
1203 1203
         }
@@ -1216,8 +1216,8 @@  discard block
 block discarded – undo
1216 1216
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
1217 1217
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
1218 1218
 		foreach ( $delete_settings as $index ) {
1219
-			if ( isset( $form_options[ $index ] ) ) {
1220
-				unset( $form_options[ $index ] );
1219
+			if ( isset( $form_options[$index] ) ) {
1220
+				unset( $form_options[$index] );
1221 1221
 			}
1222 1222
 		}
1223 1223
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -1270,12 +1270,12 @@  discard block
 block discarded – undo
1270 1270
 			'reply_to_name' => '',
1271 1271
 		);
1272 1272
         foreach ( $reply_fields as $f => $val ) {
1273
-			if ( isset( $notification[ $f ] ) ) {
1274
-				$atts[ $f ] = $notification[ $f ];
1275
-				if ( 'custom' == $notification[ $f ] ) {
1276
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
1277
-				} else if ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
1278
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
1273
+			if ( isset( $notification[$f] ) ) {
1274
+				$atts[$f] = $notification[$f];
1275
+				if ( 'custom' == $notification[$f] ) {
1276
+					$atts[$f] = $notification['cust_' . $f];
1277
+				} else if ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
1278
+					$atts[$f] = '[' . $atts[$f] . ']';
1279 1279
                 }
1280 1280
             }
1281 1281
             unset( $f, $val );
@@ -1306,13 +1306,13 @@  discard block
 block discarded – undo
1306 1306
         foreach ( $atts['email_to'] as $key => $email_field ) {
1307 1307
 
1308 1308
             if ( is_numeric( $email_field ) ) {
1309
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
1309
+				$atts['email_to'][$key] = '[' . $email_field . ']';
1310 1310
             }
1311 1311
 
1312 1312
 			if ( strpos( $email_field, '|' ) ) {
1313 1313
                 $email_opt = explode( '|', $email_field );
1314 1314
                 if ( isset( $email_opt[0] ) ) {
1315
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1315
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1316 1316
                 }
1317 1317
                 unset( $email_opt );
1318 1318
             }
@@ -1333,12 +1333,12 @@  discard block
 block discarded – undo
1333 1333
         // Add more fields to the new notification
1334 1334
         $add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
1335 1335
         foreach ( $add_fields as $add_field ) {
1336
-			if ( isset( $notification[ $add_field ] ) ) {
1337
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
1336
+			if ( isset( $notification[$add_field] ) ) {
1337
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
1338 1338
             } else if ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
1339
-				$new_notification['post_content'][ $add_field ] = 0;
1339
+				$new_notification['post_content'][$add_field] = 0;
1340 1340
             } else {
1341
-				$new_notification['post_content'][ $add_field ] = '';
1341
+				$new_notification['post_content'][$add_field] = '';
1342 1342
             }
1343 1343
             unset( $add_field );
1344 1344
         }
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
1363 1363
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
1364 1364
 				if ( is_numeric( $email_key ) ) {
1365
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1365
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1366 1366
 				}
1367 1367
 				unset( $email_key, $val );
1368 1368
 			}
Please login to merge, or discard this patch.