Completed
Pull Request — master (#2052)
by
unknown
47s
created
classes/views/frm-forms/mb_insert_fields.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 $data_attrs = array( 'data-contextual-shortcodes' => FrmAppHelper::maybe_json_encode(
8 8
 			array(
9 9
 				'address' => array_keys( $contextual_shortcodes['address'] ),
10
-				'body'    => array_keys( $contextual_shortcodes['body']  )
10
+				'body'    => array_keys( $contextual_shortcodes['body'] )
11 11
 			)
12 12
 		)
13 13
 	);
Please login to merge, or discard this patch.
classes/controllers/FrmFormsController.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 			 * @param string|null $src
654 654
 			 * @return string
655 655
 			 */
656
-			function ( $src ) {
656
+			function( $src ) {
657 657
 				if ( is_null( $src ) ) {
658 658
 					$src = '';
659 659
 				}
@@ -718,11 +718,11 @@  discard block
 block discarded – undo
718 718
 			),
719 719
 		);
720 720
 
721
-		if ( ! isset( $available_status[ $status ] ) ) {
721
+		if ( ! isset( $available_status[$status] ) ) {
722 722
 			return;
723 723
 		}
724 724
 
725
-		FrmAppHelper::permission_check( $available_status[ $status ]['permission'] );
725
+		FrmAppHelper::permission_check( $available_status[$status]['permission'] );
726 726
 
727 727
 		$params = FrmForm::list_page_params();
728 728
 
@@ -730,8 +730,8 @@  discard block
 block discarded – undo
730 730
 		check_admin_referer( $status . '_form_' . $params['id'] );
731 731
 
732 732
 		$count = 0;
733
-		if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) {
734
-			++$count;
733
+		if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) {
734
+			++ $count;
735 735
 		}
736 736
 
737 737
 		$form_type = FrmAppHelper::get_simple_request(
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 		/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
748 748
 		$available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' );
749 749
 
750
-		$message = $available_status[ $status ]['message'];
750
+		$message = $available_status[$status]['message'];
751 751
 
752 752
 		self::display_forms_list( $params, $message );
753 753
 	}
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 		$count = 0;
763 763
 		foreach ( $ids as $id ) {
764 764
 			if ( FrmForm::trash( $id ) ) {
765
-				++$count;
765
+				++ $count;
766 766
 			}
767 767
 		}
768 768
 
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 				'type'  => 'request',
773 773
 			)
774 774
 		);
775
-		$message      = sprintf(
775
+		$message = sprintf(
776 776
 			/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
777 777
 			_n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ),
778 778
 			$count,
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 
794 794
 		$count = 0;
795 795
 		if ( FrmForm::destroy( $params['id'] ) ) {
796
-			++$count;
796
+			++ $count;
797 797
 		}
798 798
 
799 799
 		/* translators: %1$s: Number of forms */
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 		foreach ( $ids as $id ) {
814 814
 			$d = FrmForm::destroy( $id );
815 815
 			if ( $d ) {
816
-				++$count;
816
+				++ $count;
817 817
 			}
818 818
 		}
819 819
 
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
 
1307 1307
 		add_action(
1308 1308
 			'wp_enqueue_editor',
1309
-			function () {
1309
+			function() {
1310 1310
 				wp_print_media_templates();
1311 1311
 			}
1312 1312
 		);
@@ -1411,7 +1411,7 @@  discard block
 block discarded – undo
1411 1411
 
1412 1412
 		foreach ( array( 'landing', 'chat', 'abandonment' ) as $feature ) {
1413 1413
 			if ( ! FrmAppHelper::show_new_feature( $feature ) ) {
1414
-				unset( $sections[ $feature ] );
1414
+				unset( $sections[$feature] );
1415 1415
 			}
1416 1416
 		}
1417 1417
 
@@ -1439,7 +1439,7 @@  discard block
 block discarded – undo
1439 1439
 				$section['id'] = $section['anchor'];
1440 1440
 			}
1441 1441
 
1442
-			$sections[ $key ] = $section;
1442
+			$sections[$key] = $section;
1443 1443
 		}//end foreach
1444 1444
 
1445 1445
 		return $sections;
@@ -1562,7 +1562,7 @@  discard block
 block discarded – undo
1562 1562
 		if ( $user_fields ) {
1563 1563
 			$user_helpers = array();
1564 1564
 			foreach ( $user_fields as $uk => $uf ) {
1565
-				$user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf;
1565
+				$user_helpers['|user_id| show="' . $uk . '"'] = $uf;
1566 1566
 				unset( $uk, $uf );
1567 1567
 			}
1568 1568
 
@@ -1676,7 +1676,7 @@  discard block
 block discarded – undo
1676 1676
 		}
1677 1677
 
1678 1678
 		if ( $settings_tab ) {
1679
-			$entry_shortcodes['form_name']       = __( 'Form Name', 'formidable' );
1679
+			$entry_shortcodes['form_name'] = __( 'Form Name', 'formidable' );
1680 1680
 		}
1681 1681
 
1682 1682
 		/**
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 		if ( ! isset( $frm_vars['js_validate_forms'] ) ) {
1722 1722
 			$frm_vars['js_validate_forms'] = array();
1723 1723
 		}
1724
-		$frm_vars['js_validate_forms'][ $form->id ] = $form;
1724
+		$frm_vars['js_validate_forms'][$form->id] = $form;
1725 1725
 	}
1726 1726
 
1727 1727
 	public static function get_email_html() {
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
 				add_filter( 'frm_validate_form', 'FrmFormsController::json_error' );
1893 1893
 			} else {
1894 1894
 				$vars   = FrmAppHelper::json_to_array( $json_vars );
1895
-				$action = $vars[ $action ];
1895
+				$action = $vars[$action];
1896 1896
 				unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1897 1897
 				$_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1898 1898
 				$_POST    = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
@@ -2065,7 +2065,7 @@  discard block
 block discarded – undo
2065 2065
 		$actions = array();
2066 2066
 		foreach ( $frm_vars['forms_loaded'] as $form ) {
2067 2067
 			if ( is_object( $form ) ) {
2068
-				$actions[ $form->id ] = $form->name;
2068
+				$actions[$form->id] = $form->name;
2069 2069
 			}
2070 2070
 			unset( $form );
2071 2071
 		}
@@ -2310,8 +2310,8 @@  discard block
 block discarded – undo
2310 2310
 	private static function get_saved_errors( $form, $params ) {
2311 2311
 		global $frm_vars;
2312 2312
 
2313
-		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2314
-			$errors = $frm_vars['created_entries'][ $form->id ]['errors'];
2313
+		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2314
+			$errors = $frm_vars['created_entries'][$form->id]['errors'];
2315 2315
 		} else {
2316 2316
 			$errors = array();
2317 2317
 		}
@@ -2333,7 +2333,7 @@  discard block
 block discarded – undo
2333 2333
 	public static function just_created_entry( $form_id ) {
2334 2334
 		global $frm_vars;
2335 2335
 
2336
-		return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0;
2336
+		return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0;
2337 2337
 	}
2338 2338
 
2339 2339
 	/**
@@ -2353,7 +2353,7 @@  discard block
 block discarded – undo
2353 2353
 	private static function get_confirmation_method( $atts ) {
2354 2354
 		$action = FrmOnSubmitHelper::current_event( $atts );
2355 2355
 		$opt    = 'update' === $action ? 'edit_action' : 'success_action';
2356
-		$method = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message';
2356
+		$method = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message';
2357 2357
 
2358 2358
 		if ( ! empty( $atts['entry_id'] ) ) {
2359 2359
 			$met_actions = self::get_met_on_submit_actions( $atts, $action );
@@ -2374,7 +2374,7 @@  discard block
 block discarded – undo
2374 2374
 	public static function maybe_trigger_redirect( $form, $params, $args ) {
2375 2375
 		if ( ! isset( $params['id'] ) ) {
2376 2376
 			global $frm_vars;
2377
-			$params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id'];
2377
+			$params['id'] = $frm_vars['created_entries'][$form->id]['entry_id'];
2378 2378
 		}
2379 2379
 
2380 2380
 		$conf_method = self::get_confirmation_method(
@@ -2456,7 +2456,7 @@  discard block
 block discarded – undo
2456 2456
 		$args['success_opt'] = $opt;
2457 2457
 		$args['ajax']        = ! empty( $frm_vars['ajax'] );
2458 2458
 
2459
-		if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) {
2459
+		if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) {
2460 2460
 			self::load_page_after_submit( $args );
2461 2461
 		} elseif ( $args['conf_method'] === 'redirect' ) {
2462 2462
 			self::redirect_after_submit( $args );
@@ -2480,7 +2480,7 @@  discard block
 block discarded – undo
2480 2480
 		}
2481 2481
 
2482 2482
 		// If a redirect action has already opened the URL in a new tab, we show the default message in the current tab.
2483
-		if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) {
2483
+		if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) {
2484 2484
 			return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) );
2485 2485
 		}
2486 2486
 
@@ -2668,7 +2668,7 @@  discard block
 block discarded – undo
2668 2668
 
2669 2669
 		$opt = 'update' === $args['action'] ? 'edit_' : 'success_';
2670 2670
 
2671
-		$new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ];
2671
+		$new_args['conf_method'] = $new_args['form']->options[$opt . 'action'];
2672 2672
 
2673 2673
 		/**
2674 2674
 		 * Filters the run success action args.
@@ -2688,8 +2688,8 @@  discard block
 block discarded – undo
2688 2688
 	private static function load_page_after_submit( $args ) {
2689 2689
 		global $post;
2690 2690
 		$opt = $args['success_opt'];
2691
-		if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) {
2692
-			$page     = get_post( $args['form']->options[ $opt . '_page_id' ] );
2691
+		if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) {
2692
+			$page     = get_post( $args['form']->options[$opt . '_page_id'] );
2693 2693
 			$old_post = $post;
2694 2694
 			$post     = $page;
2695 2695
 			$content  = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] );
@@ -2719,7 +2719,7 @@  discard block
 block discarded – undo
2719 2719
 		add_filter( 'frm_use_wpautop', '__return_false' );
2720 2720
 
2721 2721
 		$opt         = $args['success_opt'];
2722
-		$success_url = trim( $args['form']->options[ $opt . '_url' ] );
2722
+		$success_url = trim( $args['form']->options[$opt . '_url'] );
2723 2723
 		$success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] );
2724 2724
 		$success_url = do_shortcode( $success_url );
2725 2725
 
@@ -2741,7 +2741,7 @@  discard block
 block discarded – undo
2741 2741
 			// Not AJAX submit, no headers sent, and there is just one Redirect action runs.
2742 2742
 			if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) {
2743 2743
 				self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args );
2744
-				self::$redirected_in_new_tab[ $args['form']->id ] = 1;
2744
+				self::$redirected_in_new_tab[$args['form']->id] = 1;
2745 2745
 				return;
2746 2746
 			}
2747 2747
 
@@ -3001,7 +3001,7 @@  discard block
 block discarded – undo
3001 3001
 			'description' => false,
3002 3002
 			'reset'       => false,
3003 3003
 		);
3004
-		$args     = wp_parse_args( $args, $defaults );
3004
+		$args = wp_parse_args( $args, $defaults );
3005 3005
 	}
3006 3006
 
3007 3007
 	/**
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
 		$opt          = isset( $args['success_opt'] ) ? $args['success_opt'] : 'success';
3040 3040
 
3041 3041
 		if ( $entry_id && is_numeric( $entry_id ) ) {
3042
-			$message = isset( $form->options[ $opt . '_msg' ] ) ? $form->options[ $opt . '_msg' ] : $frm_settings->success_msg;
3042
+			$message = isset( $form->options[$opt . '_msg'] ) ? $form->options[$opt . '_msg'] : $frm_settings->success_msg;
3043 3043
 			$class   = 'frm_message';
3044 3044
 		} else {
3045 3045
 			$message = $frm_settings->failed_msg;
@@ -3262,8 +3262,8 @@  discard block
 block discarded – undo
3262 3262
 
3263 3263
 		check_ajax_referer( 'frm_ajax', 'nonce' );
3264 3264
 
3265
-		$html             = FrmAppHelper::clip(
3266
-			function () {
3265
+		$html = FrmAppHelper::clip(
3266
+			function() {
3267 3267
 				FrmAppHelper::maybe_autocomplete_pages_options(
3268 3268
 					array(
3269 3269
 						'field_name'  => 'frm_page_dropdown',
Please login to merge, or discard this patch.