Cancelled
Pull Request — master (#1031)
by Stephanie
01:01
created
classes/helpers/FrmStylesPreviewHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@
 block discarded – undo
168 168
 			return;
169 169
 		}
170 170
 
171
-		unset( $dependencies[ $index ] );
171
+		unset( $dependencies[$index] );
172 172
 		$dependencies = array_values( $dependencies );
173 173
 
174 174
 		$styles->registered['wp-admin']->deps = $dependencies;
Please login to merge, or discard this patch.
classes/helpers/FrmStylesCardHelper.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 				continue;
206 206
 			}
207 207
 
208
-			$value = $style->post_content[ $key ];
208
+			$value = $style->post_content[$key];
209 209
 
210 210
 			if ( in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) ) {
211 211
 				$value = '#' . $value;
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 
332 332
 				$hidden = $count > ( self::PAGE_SIZE - 1 );
333 333
 				if ( $this->echo_card_template( $style, $hidden ) ) {
334
-					++$count;
334
+					++ $count;
335 335
 				}
336 336
 			}
337 337
 		);
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 			function( $style ) use ( &$count ) {
357 357
 				$hidden = $count > ( self::PAGE_SIZE - 1 );
358 358
 				$this->echo_style_card( $style, $hidden );
359
-				++$count;
359
+				++ $count;
360 360
 			}
361 361
 		);
362 362
 
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -349,12 +349,12 @@
 block discarded – undo
349 349
 		array_walk(
350 350
 			$styles,
351 351
 			/**
352
-			* Echo a style card for a single style in the $styles array.
353
-			*
354
-			* @param WP_Post $style
355
-			* @param int     $count Used for pagination.
356
-			* @return void
357
-			*/
352
+			 * Echo a style card for a single style in the $styles array.
353
+			 *
354
+			 * @param WP_Post $style
355
+			 * @param int     $count Used for pagination.
356
+			 * @return void
357
+			 */
358 358
 			function( $style ) use ( &$count ) {
359 359
 				$hidden = $count > ( self::PAGE_SIZE - 1 );
360 360
 				$this->echo_style_card( $style, $hidden );
Please login to merge, or discard this patch.
classes/controllers/FrmFormsController.php 2 patches
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1697,7 +1697,8 @@  discard block
 block discarded – undo
1697 1697
 		$vars   = array();
1698 1698
 		FrmAppHelper::include_svg();
1699 1699
 
1700
-		if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1700
+		if ( isset( $_POST['frm_compact_fields'] ) ) {
1701
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1701 1702
 			FrmAppHelper::permission_check( 'frm_edit_forms' );
1702 1703
 
1703 1704
 			// Javascript needs to be allowed in some field settings.
@@ -2007,7 +2008,8 @@  discard block
 block discarded – undo
2007 2008
 	private static function maybe_get_form_to_show( $id ) {
2008 2009
 		$form = false;
2009 2010
 
2010
-		if ( ! empty( $id ) ) { // form id or key is set
2011
+		if ( ! empty( $id ) ) {
2012
+// form id or key is set
2011 2013
 			$form = FrmForm::getOne( $id );
2012 2014
 			if ( ! $form || $form->parent_form_id || $form->status === 'trash' ) {
2013 2015
 				$form = false;
@@ -2090,7 +2092,8 @@  discard block
 block discarded – undo
2090 2092
 	private static function get_saved_errors( $form, $params ) {
2091 2093
 		global $frm_vars;
2092 2094
 
2093
-		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2095
+		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) {
2096
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
2094 2097
 			$errors = $frm_vars['created_entries'][ $form->id ]['errors'];
2095 2098
 		} else {
2096 2099
 			$errors = array();
@@ -2243,7 +2246,8 @@  discard block
 block discarded – undo
2243 2246
 			}
2244 2247
 
2245 2248
 			if ( 'redirect' === FrmOnSubmitHelper::get_action_type( $action ) ) {
2246
-				if ( $has_redirect ) { // Do not process because we run the first redirect action only.
2249
+				if ( $has_redirect ) {
2250
+// Do not process because we run the first redirect action only.
2247 2251
 					continue;
2248 2252
 				}
2249 2253
 
@@ -2412,7 +2416,8 @@  discard block
 block discarded – undo
2412 2416
 				)
2413 2417
 			);
2414 2418
 			wp_die();
2415
-		} elseif ( ! headers_sent() && empty( $args['time_to_read'] ) ) { // Not AJAX submit and there is just one On Submit action runs.
2419
+		} elseif ( ! headers_sent() && empty( $args['time_to_read'] ) ) {
2420
+// Not AJAX submit and there is just one On Submit action runs.
2416 2421
 			wp_redirect( esc_url_raw( $success_url ) );
2417 2422
 			die(); // do not use wp_die or redirect fails
2418 2423
 		}
@@ -2437,7 +2442,8 @@  discard block
 block discarded – undo
2437 2442
 
2438 2443
 		echo FrmAppHelper::maybe_kses( $redirect_msg ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2439 2444
 		echo '<script>';
2440
-		if ( empty( $args['doing_ajax'] ) ) { // Not AJAX submit, delay JS until window.load.
2445
+		if ( empty( $args['doing_ajax'] ) ) {
2446
+// Not AJAX submit, delay JS until window.load.
2441 2447
 			echo 'window.onload=function(){';
2442 2448
 		}
2443 2449
 		echo 'setTimeout(function(){window.location="' . esc_url_raw( $args['success_url'] ) . '";}, ' . intval( $delay_time ) . ');';
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -509,11 +509,11 @@  discard block
 block discarded – undo
509 509
 			),
510 510
 		);
511 511
 
512
-		if ( ! isset( $available_status[ $status ] ) ) {
512
+		if ( ! isset( $available_status[$status] ) ) {
513 513
 			return;
514 514
 		}
515 515
 
516
-		FrmAppHelper::permission_check( $available_status[ $status ]['permission'] );
516
+		FrmAppHelper::permission_check( $available_status[$status]['permission'] );
517 517
 
518 518
 		$params = FrmForm::list_page_params();
519 519
 
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 		check_admin_referer( $status . '_form_' . $params['id'] );
522 522
 
523 523
 		$count = 0;
524
-		if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) {
524
+		if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) {
525 525
 			$count ++;
526 526
 		}
527 527
 
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 		/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
539 539
 		$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>' );
540 540
 
541
-		$message = $available_status[ $status ]['message'];
541
+		$message = $available_status[$status]['message'];
542 542
 
543 543
 		self::display_forms_list( $params, $message );
544 544
 	}
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 				'type'  => 'request',
560 560
 			)
561 561
 		);
562
-		$message      = sprintf(
562
+		$message = sprintf(
563 563
 			/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
564 564
 			_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' ),
565 565
 			$count,
@@ -998,11 +998,11 @@  discard block
 block discarded – undo
998 998
 			}
999 999
 
1000 1000
 			foreach ( $template['categories'] as $category ) {
1001
-				if ( ! isset( $templates_by_category[ $category ] ) ) {
1002
-					$templates_by_category[ $category ] = array();
1001
+				if ( ! isset( $templates_by_category[$category] ) ) {
1002
+					$templates_by_category[$category] = array();
1003 1003
 				}
1004 1004
 
1005
-				$templates_by_category[ $category ][] = $template;
1005
+				$templates_by_category[$category][] = $template;
1006 1006
 			}
1007 1007
 		}
1008 1008
 		unset( $template );
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 		$forms                    = FrmForm::get_published_forms( $where );
1032 1032
 		$view_path                = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/';
1033 1033
 
1034
-		$templates_by_category[ $my_templates_translation ] = $custom_templates;
1034
+		$templates_by_category[$my_templates_translation] = $custom_templates;
1035 1035
 
1036 1036
 		unset( $pricing, $license_type, $where );
1037 1037
 		wp_enqueue_script( 'accordion' ); // register accordion for template groups
@@ -1274,7 +1274,7 @@  discard block
 block discarded – undo
1274 1274
 
1275 1275
 		foreach ( array( 'landing', 'chat' ) as $feature ) {
1276 1276
 			if ( ! FrmAppHelper::show_new_feature( $feature ) ) {
1277
-				unset( $sections[ $feature ] );
1277
+				unset( $sections[$feature] );
1278 1278
 			}
1279 1279
 		}
1280 1280
 
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 				$section['id'] = $section['anchor'];
1308 1308
 			}
1309 1309
 
1310
-			$sections[ $key ] = $section;
1310
+			$sections[$key] = $section;
1311 1311
 		}
1312 1312
 
1313 1313
 		return $sections;
@@ -1425,7 +1425,7 @@  discard block
 block discarded – undo
1425 1425
 		if ( ! empty( $user_fields ) ) {
1426 1426
 			$user_helpers = array();
1427 1427
 			foreach ( $user_fields as $uk => $uf ) {
1428
-				$user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf;
1428
+				$user_helpers['|user_id| show="' . $uk . '"'] = $uf;
1429 1429
 				unset( $uk, $uf );
1430 1430
 			}
1431 1431
 
@@ -1557,7 +1557,7 @@  discard block
 block discarded – undo
1557 1557
 		if ( ! isset( $frm_vars['js_validate_forms'] ) ) {
1558 1558
 			$frm_vars['js_validate_forms'] = array();
1559 1559
 		}
1560
-		$frm_vars['js_validate_forms'][ $form->id ] = $form;
1560
+		$frm_vars['js_validate_forms'][$form->id] = $form;
1561 1561
 	}
1562 1562
 
1563 1563
 	public static function get_email_html() {
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
 				add_filter( 'frm_validate_form', 'FrmFormsController::json_error' );
1713 1713
 			} else {
1714 1714
 				$vars   = FrmAppHelper::json_to_array( $json_vars );
1715
-				$action = $vars[ $action ];
1715
+				$action = $vars[$action];
1716 1716
 				unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1717 1717
 				$_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1718 1718
 				$_POST    = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
 		$actions = array();
1847 1847
 		foreach ( $frm_vars['forms_loaded'] as $form ) {
1848 1848
 			if ( is_object( $form ) ) {
1849
-				$actions[ $form->id ] = $form->name;
1849
+				$actions[$form->id] = $form->name;
1850 1850
 			}
1851 1851
 			unset( $form );
1852 1852
 		}
@@ -2087,8 +2087,8 @@  discard block
 block discarded – undo
2087 2087
 	private static function get_saved_errors( $form, $params ) {
2088 2088
 		global $frm_vars;
2089 2089
 
2090
-		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2091
-			$errors = $frm_vars['created_entries'][ $form->id ]['errors'];
2090
+		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2091
+			$errors = $frm_vars['created_entries'][$form->id]['errors'];
2092 2092
 		} else {
2093 2093
 			$errors = array();
2094 2094
 		}
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
 	public static function just_created_entry( $form_id ) {
2111 2111
 		global $frm_vars;
2112 2112
 
2113
-		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;
2113
+		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;
2114 2114
 	}
2115 2115
 
2116 2116
 	/**
@@ -2127,7 +2127,7 @@  discard block
 block discarded – undo
2127 2127
 	 */
2128 2128
 	private static function get_confirmation_method( $atts ) {
2129 2129
 		$opt    = 'success_action';
2130
-		$method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message';
2130
+		$method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message';
2131 2131
 		$method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' );
2132 2132
 
2133 2133
 		if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) {
@@ -2140,7 +2140,7 @@  discard block
 block discarded – undo
2140 2140
 	public static function maybe_trigger_redirect( $form, $params, $args ) {
2141 2141
 		if ( ! isset( $params['id'] ) ) {
2142 2142
 			global $frm_vars;
2143
-			$params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id'];
2143
+			$params['id'] = $frm_vars['created_entries'][$form->id]['entry_id'];
2144 2144
 		}
2145 2145
 
2146 2146
 		$conf_method = self::get_confirmation_method(
@@ -2196,7 +2196,7 @@  discard block
 block discarded – undo
2196 2196
 		$opt = ( ! isset( $args['action'] ) || $args['action'] === 'create' ) ? 'success' : 'edit';
2197 2197
 
2198 2198
 		$args['success_opt'] = $opt;
2199
-		if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) {
2199
+		if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) {
2200 2200
 			self::load_page_after_submit( $args );
2201 2201
 		} elseif ( $args['conf_method'] === 'redirect' ) {
2202 2202
 			self::redirect_after_submit( $args );
@@ -2339,7 +2339,7 @@  discard block
 block discarded – undo
2339 2339
 
2340 2340
 		$opt = 'update' === $args['action'] ? 'edit_' : 'success_';
2341 2341
 
2342
-		$new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ];
2342
+		$new_args['conf_method'] = $new_args['form']->options[$opt . 'action'];
2343 2343
 
2344 2344
 		/**
2345 2345
 		 * Filters the run success action args.
@@ -2359,8 +2359,8 @@  discard block
 block discarded – undo
2359 2359
 	private static function load_page_after_submit( $args ) {
2360 2360
 		global $post;
2361 2361
 		$opt = $args['success_opt'];
2362
-		if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) {
2363
-			$page     = get_post( $args['form']->options[ $opt . '_page_id' ] );
2362
+		if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) {
2363
+			$page     = get_post( $args['form']->options[$opt . '_page_id'] );
2364 2364
 			$old_post = $post;
2365 2365
 			$post     = $page;
2366 2366
 			$content  = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] );
@@ -2379,11 +2379,11 @@  discard block
 block discarded – undo
2379 2379
 		add_filter( 'frm_use_wpautop', '__return_false' );
2380 2380
 
2381 2381
 		$opt         = $args['success_opt'];
2382
-		$success_url = trim( $args['form']->options[ $opt . '_url' ] );
2382
+		$success_url = trim( $args['form']->options[$opt . '_url'] );
2383 2383
 		$success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] );
2384 2384
 		$success_url = do_shortcode( $success_url );
2385 2385
 
2386
-		$success_msg = isset( $args['form']->options[ $opt . '_msg' ] ) ? $args['form']->options[ $opt . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' );
2386
+		$success_msg = isset( $args['form']->options[$opt . '_msg'] ) ? $args['form']->options[$opt . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' );
2387 2387
 
2388 2388
 		$redirect_msg = self::get_redirect_message( $success_url, $success_msg, $args );
2389 2389
 
@@ -2422,7 +2422,7 @@  discard block
 block discarded – undo
2422 2422
 	 * @param array $args See {@see FrmFormsController::run_success_action()}.
2423 2423
 	 */
2424 2424
 	private static function redirect_after_submit_using_js( $args ) {
2425
-		$success_msg  = isset( $args['form']->options[ $args['success_opt'] . '_msg' ] ) ? $args['form']->options[ $args['success_opt'] . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' );
2425
+		$success_msg  = isset( $args['form']->options[$args['success_opt'] . '_msg'] ) ? $args['form']->options[$args['success_opt'] . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' );
2426 2426
 		$redirect_msg = self::get_redirect_message( $args['success_url'], $success_msg, $args );
2427 2427
 		$delay_time   = $args['time_to_read'];
2428 2428
 
@@ -2551,7 +2551,7 @@  discard block
 block discarded – undo
2551 2551
 			'description' => false,
2552 2552
 			'reset'       => false,
2553 2553
 		);
2554
-		$args     = wp_parse_args( $args, $defaults );
2554
+		$args = wp_parse_args( $args, $defaults );
2555 2555
 	}
2556 2556
 
2557 2557
 	/**
@@ -2803,7 +2803,7 @@  discard block
 block discarded – undo
2803 2803
 
2804 2804
 		check_ajax_referer( 'frm_ajax', 'nonce' );
2805 2805
 
2806
-		$html             = FrmAppHelper::clip(
2806
+		$html = FrmAppHelper::clip(
2807 2807
 			function() {
2808 2808
 				FrmAppHelper::maybe_autocomplete_pages_options(
2809 2809
 					array(
@@ -2874,28 +2874,28 @@  discard block
 block discarded – undo
2874 2874
 	public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) {
2875 2875
 		$opt = 'update' === $event ? 'edit_' : 'success_';
2876 2876
 		if ( ! $action || ! is_object( $action ) ) {
2877
-			$form_options[ $opt . 'action' ] = FrmOnSubmitHelper::get_default_action_type();
2878
-			$form_options[ $opt . 'msg' ]    = FrmOnSubmitHelper::get_default_msg();
2877
+			$form_options[$opt . 'action'] = FrmOnSubmitHelper::get_default_action_type();
2878
+			$form_options[$opt . 'msg']    = FrmOnSubmitHelper::get_default_msg();
2879 2879
 			return;
2880 2880
 		}
2881 2881
 
2882
-		$form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message';
2882
+		$form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message';
2883 2883
 
2884
-		switch ( $form_options[ $opt . 'action' ] ) {
2884
+		switch ( $form_options[$opt . 'action'] ) {
2885 2885
 			case 'redirect':
2886
-				$form_options[ $opt . 'url' ] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : '';
2886
+				$form_options[$opt . 'url'] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : '';
2887 2887
 				$form_options['redirect_msg'] = isset( $action->post_content['redirect_msg'] ) ? $action->post_content['redirect_msg'] : FrmOnSubmitHelper::get_default_redirect_msg();
2888
-				$form_options[ $opt . 'msg' ] = $form_options['redirect_msg'];
2888
+				$form_options[$opt . 'msg'] = $form_options['redirect_msg'];
2889 2889
 				$form_options['time_to_read'] = isset( $action->post_content['time_to_read'] ) ? $action->post_content['time_to_read'] : 0;
2890 2890
 				break;
2891 2891
 
2892 2892
 			case 'page':
2893
-				$form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : '';
2893
+				$form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : '';
2894 2894
 				break;
2895 2895
 
2896 2896
 			default:
2897
-				$form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : FrmOnSubmitHelper::get_default_msg();
2898
-				$form_options['show_form']   = ! empty( $action->post_content['show_form'] );
2897
+				$form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : FrmOnSubmitHelper::get_default_msg();
2898
+				$form_options['show_form'] = ! empty( $action->post_content['show_form'] );
2899 2899
 		}
2900 2900
 	}
2901 2901
 
@@ -2973,21 +2973,21 @@  discard block
 block discarded – undo
2973 2973
 	private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) {
2974 2974
 		$opt  = 'update' === $event ? 'edit_' : 'success_';
2975 2975
 		$data = array(
2976
-			'success_action' => $form_options[ $opt . 'action' ],
2976
+			'success_action' => $form_options[$opt . 'action'],
2977 2977
 		);
2978 2978
 
2979
-		switch ( $form_options[ $opt . 'action' ] ) {
2979
+		switch ( $form_options[$opt . 'action'] ) {
2980 2980
 			case 'redirect':
2981
-				$data['success_url']  = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : '';
2982
-				$data['redirect_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : FrmOnSubmitHelper::get_default_redirect_msg();
2981
+				$data['success_url']  = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : '';
2982
+				$data['redirect_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : FrmOnSubmitHelper::get_default_redirect_msg();
2983 2983
 				break;
2984 2984
 
2985 2985
 			case 'page':
2986
-				$data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : '';
2986
+				$data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : '';
2987 2987
 				break;
2988 2988
 
2989 2989
 			default:
2990
-				$data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : FrmOnSubmitHelper::get_default_msg();
2990
+				$data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : FrmOnSubmitHelper::get_default_msg();
2991 2991
 				$data['show_form']   = ! empty( $form_options['show_form'] );
2992 2992
 		}
2993 2993
 
@@ -3022,8 +3022,8 @@  discard block
 block discarded – undo
3022 3022
 		}
3023 3023
 
3024 3024
 		foreach ( $options as $name ) {
3025
-			if ( isset( $form->options[ $name ] ) ) {
3026
-				unset( $form->options[ $name ] );
3025
+			if ( isset( $form->options[$name] ) ) {
3026
+				unset( $form->options[$name] );
3027 3027
 			}
3028 3028
 		}
3029 3029
 
Please login to merge, or discard this patch.