Test Failed
Pull Request — master (#2211)
by Ravinder
05:56 queued 47s
created
templates/single-give-form/sidebar.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
  * @since       1.0
12 12
  */
13 13
 
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit; // Exit if accessed directly.
16 16
 }
17
-if ( is_active_sidebar( 'give-forms-sidebar' ) ) {
18
-	dynamic_sidebar( 'give-forms-sidebar' );
17
+if (is_active_sidebar('give-forms-sidebar')) {
18
+	dynamic_sidebar('give-forms-sidebar');
19 19
 }
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
templates/single-give-form/content-single-give-form.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @version       1.0
9 9
  */
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit; // Exit if accessed directly.
13 13
 }
14 14
 
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @since 1.0
21 21
  */
22
-do_action( 'give_before_single_form' );
22
+do_action('give_before_single_form');
23 23
 
24
-if ( post_password_required() ) {
24
+if (post_password_required()) {
25 25
 	echo get_the_password_form();
26 26
 	return;
27 27
 }
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
 		 *
38 38
 		 * @since 1.0
39 39
 		 */
40
-		do_action( 'give_before_single_form_summary' );
40
+		do_action('give_before_single_form_summary');
41 41
 		?>
42 42
 
43
-		<div class="<?php echo apply_filters( 'give_forms_single_summary_classes', 'summary entry-summary' ); ?>">
43
+		<div class="<?php echo apply_filters('give_forms_single_summary_classes', 'summary entry-summary'); ?>">
44 44
 
45 45
 			<?php
46 46
 			/**
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			 *
51 51
 			 * @since 1.0
52 52
 			 */
53
-			do_action( 'give_single_form_summary' );
53
+			do_action('give_single_form_summary');
54 54
 			?>
55 55
 
56 56
 		</div>
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		 *
65 65
 		 * @since 1.0
66 66
 		 */
67
-		do_action( 'give_after_single_form_summary' );
67
+		do_action('give_after_single_form_summary');
68 68
 		?>
69 69
 
70 70
 	</div><!-- #give-form-<?php the_ID(); ?> -->
@@ -77,5 +77,5 @@  discard block
 block discarded – undo
77 77
  *
78 78
  * @since 1.0
79 79
  */
80
-do_action( 'give_after_single_form' );
80
+do_action('give_after_single_form');
81 81
 ?>
Please login to merge, or discard this patch.
templates/single-give-form/title.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @since       1.0
12 12
  */
13 13
 
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit; // Exit if accessed directly.
16 16
 } ?>
17 17
 <h1 itemprop="name" class="give-form-title entry-title"><?php the_title(); ?></h1>
Please login to merge, or discard this patch.
templates/payment-processing.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
 ?>
6 6
 <div id="give-payment-processing">
7 7
 	<?php
8
-	Give()->notices->print_frontend_notice( sprintf(
8
+	Give()->notices->print_frontend_notice(sprintf(
9 9
 	/* translators: %s: success page URL */
10
-		__( 'Your donation is processing. This page will reload automatically in 8 seconds. If it does not, click <a href="%s">here</a>.', 'give' ),
10
+		__('Your donation is processing. This page will reload automatically in 8 seconds. If it does not, click <a href="%s">here</a>.', 'give'),
11 11
 		give_get_success_page_uri()
12
-	), true, 'success' );
12
+	), true, 'success');
13 13
 	?>
14 14
 	<span class="give-loading-animation"></span>
15 15
 	<script type="text/javascript">setTimeout(function () {
Please login to merge, or discard this patch.
templates/emails/header.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@
 block discarded – undo
6 6
  * @version     1.0
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+if ( ! defined('ABSPATH')) exit; // Exit if accessed directly.
10 10
 // This is the footer used if no others are available
11 11
 ?>
12 12
 <!DOCTYPE html>
13 13
 <html>
14 14
 	<head>
15 15
 		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
16
-		<title><?php echo get_bloginfo( 'name' ); ?></title>
16
+		<title><?php echo get_bloginfo('name'); ?></title>
17 17
 	</head>
18 18
 	<body>
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,10 @@
 block discarded – undo
6 6
  * @version     1.0
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+if ( ! defined( 'ABSPATH' ) ) {
10
+	exit;
11
+}
12
+// Exit if accessed directly.
10 13
 // This is the footer used if no others are available
11 14
 ?>
12 15
 <!DOCTYPE html>
Please login to merge, or discard this patch.
templates/emails/footer-default.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @version     1.0
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+if ( ! defined('ABSPATH')) exit; // Exit if accessed directly.
10 10
 
11 11
 
12 12
 // For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline.
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                                                 <table border="0" cellpadding="10" cellspacing="0" width="100%">
45 45
                                                     <tr>
46 46
                                                         <td colspan="2" valign="middle" id="credit" style="<?php echo $credit; ?>">
47
-                                                           <?php echo wpautop( wp_kses_post( wptexturize( apply_filters( 'give_email_footer_text', '<a href="' . esc_url( home_url() ) . '">' . get_bloginfo( 'name' ) . '</a>' ) ) ) ); ?>
47
+                                                           <?php echo wpautop(wp_kses_post(wptexturize(apply_filters('give_email_footer_text', '<a href="'.esc_url(home_url()).'">'.get_bloginfo('name').'</a>')))); ?>
48 48
                                                         </td>
49 49
                                                     </tr>
50 50
                                                 </table>
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,10 @@
 block discarded – undo
6 6
  * @version     1.0
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+if ( ! defined( 'ABSPATH' ) ) {
10
+	exit;
11
+}
12
+// Exit if accessed directly.
10 13
 
11 14
 
12 15
 // For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline.
Please login to merge, or discard this patch.
templates/emails/body-default.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @version     1.0
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+if ( ! defined('ABSPATH')) exit; // Exit if accessed directly.
10 10
 
11 11
 // {email} is replaced by the content entered in Donations > Settings > Emails
12 12
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,10 @@
 block discarded – undo
6 6
  * @version     1.0
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+if ( ! defined( 'ABSPATH' ) ) {
10
+	exit;
11
+}
12
+// Exit if accessed directly.
10 13
 
11 14
 // {email} is replaced by the content entered in Donations > Settings > Emails
12 15
 
Please login to merge, or discard this patch.
templates/emails/footer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @version     1.0
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+if ( ! defined('ABSPATH')) exit; // Exit if accessed directly.
10 10
 
11 11
 // This is the footer used if no others are available
12 12
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,10 @@
 block discarded – undo
6 6
  * @version     1.0
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+if ( ! defined( 'ABSPATH' ) ) {
10
+	exit;
11
+}
12
+// Exit if accessed directly.
10 13
 
11 14
 // This is the footer used if no others are available
12 15
 
Please login to merge, or discard this patch.
includes/forms/template.php 4 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * @param  array $args An array of form arguments.
23 23
  *
24
- * @return string Donation form.
24
+ * @return false|null Donation form.
25 25
  */
26 26
 function give_get_donation_form( $args = array() ) {
27 27
 
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
  *
1489 1489
  * @param  int $form_id The form ID.
1490 1490
  *
1491
- * @return bool
1491
+ * @return false|null
1492 1492
  */
1493 1493
 function give_terms_agreement( $form_id ) {
1494 1494
 	$form_option = give_get_meta( $form_id, '_give_terms_option', true );
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
  * @param  int $form_id The form ID.
1667 1667
  * @param  array $args An array of form arguments.
1668 1668
  *
1669
- * @return mixed
1669
+ * @return boolean
1670 1670
  */
1671 1671
 function give_show_goal_progress( $form_id, $args ) {
1672 1672
 
@@ -1686,7 +1686,7 @@  discard block
 block discarded – undo
1686 1686
  *
1687 1687
  * @since  1.8
1688 1688
  *
1689
- * @param  $form_id
1689
+ * @param  integer $form_id
1690 1690
  * @param  $args
1691 1691
  *
1692 1692
  * @return mixed|string
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
  * @param  int $form_id The form ID.
1728 1728
  * @param  array $args An array of form arguments.
1729 1729
  *
1730
- * @return void|bool
1730
+ * @return false|null
1731 1731
  */
1732 1732
 function give_form_content( $form_id, $args ) {
1733 1733
 
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 			?>
344 344
         </div>
345 345
 		<?php
346
-    elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) :
346
+	elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) :
347 347
 		?>
348 348
         <div id="give-checkout-login-register-<?php echo $form_id; ?>">
349 349
 			<?php
@@ -945,10 +945,10 @@  discard block
 block discarded – undo
945 945
 			    <?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
946 946
 		    >
947 947
 			    <?php
948
-			    foreach ( $countries as $country_code => $country ) {
949
-				    echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
950
-			    }
951
-			    ?>
948
+				foreach ( $countries as $country_code => $country ) {
949
+					echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
950
+				}
951
+				?>
952 952
 		    </select>
953 953
 	    </p>
954 954
 
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 		    <label for="card_address" class="give-label">
957 957
 			    <?php esc_html_e( 'Address 1', 'give' ); ?>
958 958
 			    <?php
959
-			    if ( give_field_is_required( 'card_address', $form_id ) ) : ?>
959
+				if ( give_field_is_required( 'card_address', $form_id ) ) : ?>
960 960
 				    <span class="give-required-indicator">*</span>
961 961
 			    <?php endif; ?>
962 962
 			    <span class="give-tooltip give-icon give-icon-question"
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 		    <label for="card_state" class="give-label">
1001 1001
 			    <span class="state-label-text"><?php echo $label; ?></span>
1002 1002
 			    <?php if ( give_field_is_required( 'card_state', $form_id ) ) :
1003
-				    ?>
1003
+					?>
1004 1004
 				    <span class="give-required-indicator <?php echo( array_key_exists( $selected_country, $states_not_required_country_list ) ? 'give-hidden' : '' ) ?> ">*</span>
1005 1005
 			    <?php endif; ?>
1006 1006
 			    <span class="give-tooltip give-icon give-icon-question"
@@ -1008,17 +1008,17 @@  discard block
 block discarded – undo
1008 1008
 		    </label>
1009 1009
 		    <?php
1010 1010
 
1011
-		    if ( ! empty( $states ) ) : ?>
1011
+			if ( ! empty( $states ) ) : ?>
1012 1012
 			    <select
1013 1013
 					    name="card_state"
1014 1014
 					    id="card_state"
1015 1015
 					    class="card_state give-select<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required' : '' ); ?>"
1016 1016
 				    <?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required aria-required="true" ' : '' ); ?>>
1017 1017
 				    <?php
1018
-				    foreach ( $states as $state_code => $state ) {
1019
-					    echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
1020
-				    }
1021
-				    ?>
1018
+					foreach ( $states as $state_code => $state ) {
1019
+						echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
1020
+					}
1021
+					?>
1022 1022
 			    </select>
1023 1023
 		    <?php else : ?>
1024 1024
 			    <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input"
Please login to merge, or discard this patch.
Spacing   +402 added lines, -403 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,50 +23,50 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return string Donation form.
25 25
  */
26
-function give_get_donation_form( $args = array() ) {
26
+function give_get_donation_form($args = array()) {
27 27
 
28 28
 	global $post;
29 29
 
30
-	$form_id = is_object( $post ) ? $post->ID : 0;
30
+	$form_id = is_object($post) ? $post->ID : 0;
31 31
 
32
-	if ( isset( $args['id'] ) ) {
32
+	if (isset($args['id'])) {
33 33
 		$form_id = $args['id'];
34 34
 	}
35 35
 
36
-	$defaults = apply_filters( 'give_form_args_defaults', array(
36
+	$defaults = apply_filters('give_form_args_defaults', array(
37 37
 		'form_id' => $form_id,
38
-	) );
38
+	));
39 39
 
40
-	$args = wp_parse_args( $args, $defaults );
40
+	$args = wp_parse_args($args, $defaults);
41 41
 
42
-	$form = new Give_Donate_Form( $args['form_id'] );
42
+	$form = new Give_Donate_Form($args['form_id']);
43 43
 
44 44
 	//bail if no form ID.
45
-	if ( empty( $form->ID ) ) {
45
+	if (empty($form->ID)) {
46 46
 		return false;
47 47
 	}
48 48
 
49
-	$payment_mode = give_get_chosen_gateway( $form->ID );
49
+	$payment_mode = give_get_chosen_gateway($form->ID);
50 50
 
51
-	$form_action = add_query_arg( apply_filters( 'give_form_action_args', array(
51
+	$form_action = add_query_arg(apply_filters('give_form_action_args', array(
52 52
 		'payment-mode' => $payment_mode,
53
-	) ),
53
+	)),
54 54
 		give_get_current_page_url()
55 55
 	);
56 56
 
57 57
 	//Sanity Check: Donation form not published or user doesn't have permission to view drafts.
58 58
 	if (
59
-		( 'publish' !== $form->post_status && ! current_user_can( 'edit_give_forms', $form->ID ) )
60
-		|| ( 'trash' === $form->post_status )
59
+		('publish' !== $form->post_status && ! current_user_can('edit_give_forms', $form->ID))
60
+		|| ('trash' === $form->post_status)
61 61
 	) {
62 62
 		return false;
63 63
 	}
64 64
 
65 65
 	//Get the form wrap CSS classes.
66
-	$form_wrap_classes = $form->get_form_wrap_classes( $args );
66
+	$form_wrap_classes = $form->get_form_wrap_classes($args);
67 67
 
68 68
 	//Get the <form> tag wrap CSS classes.
69
-	$form_classes = $form->get_form_classes( $args );
69
+	$form_classes = $form->get_form_classes($args);
70 70
 
71 71
 	ob_start();
72 72
 
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
 	 * @param int $form_id The form ID.
79 79
 	 * @param array $args An array of form arguments.
80 80
 	 */
81
-	do_action( 'give_pre_form_output', $form->ID, $args );
81
+	do_action('give_pre_form_output', $form->ID, $args);
82 82
 
83 83
 	?>
84 84
     <div id="give-form-<?php echo $form->ID; ?>-wrap" class="<?php echo $form_wrap_classes; ?>">
85 85
 
86
-		<?php if ( $form->is_close_donation_form() ) {
86
+		<?php if ($form->is_close_donation_form()) {
87 87
 
88 88
 			// Get Goal thank you message.
89
-			$goal_achieved_message = give_get_meta( $form->ID, '_give_form_goal_achieved_message', true );
90
-			$goal_achieved_message = ! empty( $goal_achieved_message ) ? apply_filters( 'the_content', $goal_achieved_message ) : '';
89
+			$goal_achieved_message = give_get_meta($form->ID, '_give_form_goal_achieved_message', true);
90
+			$goal_achieved_message = ! empty($goal_achieved_message) ? apply_filters('the_content', $goal_achieved_message) : '';
91 91
 
92 92
 			// Print thank you message.
93
-			echo apply_filters( 'give_goal_closed_output', $goal_achieved_message, $form->ID );
93
+			echo apply_filters('give_goal_closed_output', $goal_achieved_message, $form->ID);
94 94
 
95 95
 		} else {
96 96
 			/**
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
 			 * 1. if show_title params set to true
99 99
 			 * 2. if admin set form display_style to button
100 100
 			 */
101
-			$form_title = apply_filters( 'give_form_title', '<h2 class="give-form-title">' . get_the_title( $form_id ) . '</h2>' );
101
+			$form_title = apply_filters('give_form_title', '<h2 class="give-form-title">'.get_the_title($form_id).'</h2>');
102 102
 			if (
103
-				( isset( $args['show_title'] ) && $args['show_title'] == true )
104
-				&& ! doing_action( 'give_single_form_summary' )
103
+				(isset($args['show_title']) && $args['show_title'] == true)
104
+				&& ! doing_action('give_single_form_summary')
105 105
 			) {
106 106
 				echo $form_title;
107 107
 			}
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
 			 * @param int $form_id The form ID.
115 115
 			 * @param array $args An array of form arguments.
116 116
 			 */
117
-			do_action( 'give_pre_form', $form->ID, $args );
117
+			do_action('give_pre_form', $form->ID, $args);
118 118
 			?>
119 119
 
120 120
             <form id="give-form-<?php echo $form_id; ?>" class="<?php echo $form_classes; ?>"
121
-                  action="<?php echo esc_url_raw( $form_action ); ?>" method="post">
121
+                  action="<?php echo esc_url_raw($form_action); ?>" method="post">
122 122
                 <input type="hidden" name="give-form-id" value="<?php echo $form->ID; ?>"/>
123
-                <input type="hidden" name="give-form-title" value="<?php echo htmlentities( $form->post_title ); ?>"/>
123
+                <input type="hidden" name="give-form-title" value="<?php echo htmlentities($form->post_title); ?>"/>
124 124
                 <input type="hidden" name="give-current-url"
125
-                       value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/>
125
+                       value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/>
126 126
                 <input type="hidden" name="give-form-url"
127
-                       value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/>
127
+                       value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/>
128 128
                 <input type="hidden" name="give-form-minimum"
129
-                       value="<?php echo give_format_amount( give_get_form_minimum_price( $form->ID ), array( 'sanitize' => false ) ); ?>"/>
129
+                       value="<?php echo give_format_amount(give_get_form_minimum_price($form->ID), array('sanitize' => false)); ?>"/>
130 130
 
131 131
                 <!-- The following field is for robots only, invisible to humans: -->
132 132
                 <span class="give-hidden" style="display: none !important;">
@@ -138,13 +138,13 @@  discard block
 block discarded – undo
138 138
 				<?php
139 139
 
140 140
 				// Price ID hidden field for variable (multi-level) donation forms.
141
-				if ( give_has_variable_prices( $form_id ) ) {
141
+				if (give_has_variable_prices($form_id)) {
142 142
 					// Get default selected price ID.
143
-					$prices   = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
143
+					$prices   = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id);
144 144
 					$price_id = 0;
145 145
 					//loop through prices.
146
-					foreach ( $prices as $price ) {
147
-						if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
146
+					foreach ($prices as $price) {
147
+						if (isset($price['_give_default']) && $price['_give_default'] === 'default') {
148 148
 							$price_id = $price['_give_id']['level_id'];
149 149
 						};
150 150
 					}
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 				 * @param int $form_id The form ID.
161 161
 				 * @param array $args An array of form arguments.
162 162
 				 */
163
-				do_action( 'give_donation_form_top', $form->ID, $args );
163
+				do_action('give_donation_form_top', $form->ID, $args);
164 164
 
165 165
 				/**
166 166
 				 * Fires while outputting donation form, for payment gateway fields.
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 				 * @param int $form_id The form ID.
171 171
 				 * @param array $args An array of form arguments.
172 172
 				 */
173
-				do_action( 'give_payment_mode_select', $form->ID, $args );
173
+				do_action('give_payment_mode_select', $form->ID, $args);
174 174
 
175 175
 				/**
176 176
 				 * Fires while outputting donation form, after all other fields.
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				 * @param int $form_id The form ID.
181 181
 				 * @param array $args An array of form arguments.
182 182
 				 */
183
-				do_action( 'give_donation_form_bottom', $form->ID, $args );
183
+				do_action('give_donation_form_bottom', $form->ID, $args);
184 184
 
185 185
 				?>
186 186
             </form>
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 			 * @param int $form_id The form ID.
195 195
 			 * @param array $args An array of form arguments.
196 196
 			 */
197
-			do_action( 'give_post_form', $form->ID, $args );
197
+			do_action('give_post_form', $form->ID, $args);
198 198
 
199 199
 		}
200 200
 		?>
201 201
 
202
-    </div><!--end #give-form-<?php echo absint( $form->ID ); ?>-->
202
+    </div><!--end #give-form-<?php echo absint($form->ID); ?>-->
203 203
 	<?php
204 204
 
205 205
 	/**
@@ -210,11 +210,11 @@  discard block
 block discarded – undo
210 210
 	 * @param int $form_id The form ID.
211 211
 	 * @param array $args An array of form arguments.
212 212
 	 */
213
-	do_action( 'give_post_form_output', $form->ID, $args );
213
+	do_action('give_post_form_output', $form->ID, $args);
214 214
 
215 215
 	$final_output = ob_get_clean();
216 216
 
217
-	echo apply_filters( 'give_donate_form', $final_output, $args );
217
+	echo apply_filters('give_donate_form', $final_output, $args);
218 218
 }
219 219
 
220 220
 /**
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
  *
232 232
  * @return string
233 233
  */
234
-function give_show_purchase_form( $form_id ) {
234
+function give_show_purchase_form($form_id) {
235 235
 
236
-	$payment_mode = give_get_chosen_gateway( $form_id );
236
+	$payment_mode = give_get_chosen_gateway($form_id);
237 237
 
238
-	if ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) {
238
+	if ( ! isset($form_id) && isset($_POST['give_form_id'])) {
239 239
 		$form_id = $_POST['give_form_id'];
240 240
 	}
241 241
 
@@ -244,33 +244,33 @@  discard block
 block discarded – undo
244 244
 	 *
245 245
 	 * @since 1.7
246 246
 	 */
247
-	do_action( 'give_payment_fields_top', $form_id );
247
+	do_action('give_payment_fields_top', $form_id);
248 248
 
249
-	if ( give_can_checkout() && isset( $form_id ) ) {
249
+	if (give_can_checkout() && isset($form_id)) {
250 250
 
251 251
 		/**
252 252
 		 * Fires while displaying donation form, before registration login.
253 253
 		 *
254 254
 		 * @since 1.7
255 255
 		 */
256
-		do_action( 'give_donation_form_before_register_login', $form_id );
256
+		do_action('give_donation_form_before_register_login', $form_id);
257 257
 
258 258
 		/**
259 259
 		 * Fire when register/login form fields render.
260 260
 		 *
261 261
 		 * @since 1.7
262 262
 		 */
263
-		do_action( 'give_donation_form_register_login_fields', $form_id );
263
+		do_action('give_donation_form_register_login_fields', $form_id);
264 264
 
265 265
 		/**
266 266
 		 * Fire when credit card form fields render.
267 267
 		 *
268 268
 		 * @since 1.7
269 269
 		 */
270
-		do_action( 'give_donation_form_before_cc_form', $form_id );
270
+		do_action('give_donation_form_before_cc_form', $form_id);
271 271
 
272 272
 		// Load the credit card form and allow gateways to load their own if they wish.
273
-		if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) {
273
+		if (has_action('give_'.$payment_mode.'_cc_form')) {
274 274
 			/**
275 275
 			 * Fires while displaying donation form, credit card form fields for a given gateway.
276 276
 			 *
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 			 *
279 279
 			 * @param int $form_id The form ID.
280 280
 			 */
281
-			do_action( "give_{$payment_mode}_cc_form", $form_id );
281
+			do_action("give_{$payment_mode}_cc_form", $form_id);
282 282
 		} else {
283 283
 			/**
284 284
 			 * Fires while displaying donation form, credit card form fields.
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 			 *
288 288
 			 * @param int $form_id The form ID.
289 289
 			 */
290
-			do_action( 'give_cc_form', $form_id );
290
+			do_action('give_cc_form', $form_id);
291 291
 		}
292 292
 
293 293
 		/**
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 		 *
296 296
 		 * @since 1.7
297 297
 		 */
298
-		do_action( 'give_donation_form_after_cc_form', $form_id );
298
+		do_action('give_donation_form_after_cc_form', $form_id);
299 299
 
300 300
 	} else {
301 301
 		/**
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		 *
304 304
 		 * @since 1.7
305 305
 		 */
306
-		do_action( 'give_donation_form_no_access', $form_id );
306
+		do_action('give_donation_form_no_access', $form_id);
307 307
 
308 308
 	}
309 309
 
@@ -312,10 +312,10 @@  discard block
 block discarded – undo
312 312
 	 *
313 313
 	 * @since 1.7
314 314
 	 */
315
-	do_action( 'give_payment_fields_bottom', $form_id );
315
+	do_action('give_payment_fields_bottom', $form_id);
316 316
 }
317 317
 
318
-add_action( 'give_donation_form', 'give_show_purchase_form' );
318
+add_action('give_donation_form', 'give_show_purchase_form');
319 319
 
320 320
 /**
321 321
  * Give Show Login/Register Form Fields.
@@ -326,11 +326,11 @@  discard block
 block discarded – undo
326 326
  *
327 327
  * @return void
328 328
  */
329
-function give_show_register_login_fields( $form_id ) {
329
+function give_show_register_login_fields($form_id) {
330 330
 
331
-	$show_register_form = give_show_login_register_option( $form_id );
331
+	$show_register_form = give_show_login_register_option($form_id);
332 332
 
333
-	if ( ( $show_register_form === 'registration' || ( $show_register_form === 'both' && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) :
333
+	if (($show_register_form === 'registration' || ($show_register_form === 'both' && ! isset($_GET['login']))) && ! is_user_logged_in()) :
334 334
 		?>
335 335
         <div id="give-checkout-login-register-<?php echo $form_id; ?>">
336 336
 			<?php
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 			 *
340 340
 			 * @since 1.7
341 341
 			 */
342
-			do_action( 'give_donation_form_register_fields', $form_id );
342
+			do_action('give_donation_form_register_fields', $form_id);
343 343
 			?>
344 344
         </div>
345 345
 		<?php
346
-    elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) :
346
+    elseif (($show_register_form === 'login' || ($show_register_form === 'both' && isset($_GET['login']))) && ! is_user_logged_in()) :
347 347
 		?>
348 348
         <div id="give-checkout-login-register-<?php echo $form_id; ?>">
349 349
 			<?php
@@ -352,23 +352,23 @@  discard block
 block discarded – undo
352 352
 			 *
353 353
 			 * @since 1.7
354 354
 			 */
355
-			do_action( 'give_donation_form_login_fields', $form_id );
355
+			do_action('give_donation_form_login_fields', $form_id);
356 356
 			?>
357 357
         </div>
358 358
 		<?php
359 359
 	endif;
360 360
 
361
-	if ( ( ! isset( $_GET['login'] ) && is_user_logged_in() ) || ! isset( $show_register_form ) || 'none' === $show_register_form || 'login' === $show_register_form ) {
361
+	if (( ! isset($_GET['login']) && is_user_logged_in()) || ! isset($show_register_form) || 'none' === $show_register_form || 'login' === $show_register_form) {
362 362
 		/**
363 363
 		 * Fire when user info render.
364 364
 		 *
365 365
 		 * @since 1.7
366 366
 		 */
367
-		do_action( 'give_donation_form_after_user_info', $form_id );
367
+		do_action('give_donation_form_after_user_info', $form_id);
368 368
 	}
369 369
 }
370 370
 
371
-add_action( 'give_donation_form_register_login_fields', 'give_show_register_login_fields' );
371
+add_action('give_donation_form_register_login_fields', 'give_show_register_login_fields');
372 372
 
373 373
 /**
374 374
  * Donation Amount Field.
@@ -383,16 +383,16 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return void
385 385
  */
386
-function give_output_donation_amount_top( $form_id = 0, $args = array() ) {
386
+function give_output_donation_amount_top($form_id = 0, $args = array()) {
387 387
 
388 388
 	$give_options        = give_get_settings();
389
-	$variable_pricing    = give_has_variable_prices( $form_id );
390
-	$allow_custom_amount = give_get_meta( $form_id, '_give_custom_amount', true );
391
-	$currency_position   = isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before';
392
-	$symbol              = give_currency_symbol( give_get_currency() );
393
-	$currency_output     = '<span class="give-currency-symbol give-currency-position-' . $currency_position . '">' . $symbol . '</span>';
394
-	$default_amount      = give_format_amount( give_get_default_form_amount( $form_id ), array( 'sanitize' => false ) );
395
-	$custom_amount_text  = give_get_meta( $form_id, '_give_custom_amount_text', true );
389
+	$variable_pricing    = give_has_variable_prices($form_id);
390
+	$allow_custom_amount = give_get_meta($form_id, '_give_custom_amount', true);
391
+	$currency_position   = isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before';
392
+	$symbol              = give_currency_symbol(give_get_currency());
393
+	$currency_output     = '<span class="give-currency-symbol give-currency-position-'.$currency_position.'">'.$symbol.'</span>';
394
+	$default_amount      = give_format_amount(give_get_default_form_amount($form_id), array('sanitize' => false));
395
+	$custom_amount_text  = give_get_meta($form_id, '_give_custom_amount_text', true);
396 396
 
397 397
 	/**
398 398
 	 * Fires while displaying donation form, before donation level fields.
@@ -402,20 +402,20 @@  discard block
 block discarded – undo
402 402
 	 * @param int $form_id The form ID.
403 403
 	 * @param array $args An array of form arguments.
404 404
 	 */
405
-	do_action( 'give_before_donation_levels', $form_id, $args );
405
+	do_action('give_before_donation_levels', $form_id, $args);
406 406
 
407 407
 	//Set Price, No Custom Amount Allowed means hidden price field
408
-	if ( ! give_is_setting_enabled( $allow_custom_amount ) ) {
408
+	if ( ! give_is_setting_enabled($allow_custom_amount)) {
409 409
 		?>
410
-        <label class="give-hidden" for="give-amount-hidden"><?php esc_html_e( 'Donation Amount:', 'give' ); ?></label>
410
+        <label class="give-hidden" for="give-amount-hidden"><?php esc_html_e('Donation Amount:', 'give'); ?></label>
411 411
         <input id="give-amount" class="give-amount-hidden" type="hidden" name="give-amount"
412 412
                value="<?php echo $default_amount; ?>" required aria-required="true"/>
413 413
         <div class="set-price give-donation-amount form-row-wide">
414
-			<?php if ( $currency_position == 'before' ) {
414
+			<?php if ($currency_position == 'before') {
415 415
 				echo $currency_output;
416 416
 			} ?>
417 417
             <span id="give-amount-text" class="give-text-input give-amount-top"><?php echo $default_amount; ?></span>
418
-			<?php if ( $currency_position == 'after' ) {
418
+			<?php if ($currency_position == 'after') {
419 419
 				echo $currency_output;
420 420
 			} ?>
421 421
         </div>
@@ -425,13 +425,13 @@  discard block
 block discarded – undo
425 425
 		?>
426 426
         <div class="give-total-wrap">
427 427
             <div class="give-donation-amount form-row-wide">
428
-				<?php if ( $currency_position == 'before' ) {
428
+				<?php if ($currency_position == 'before') {
429 429
 					echo $currency_output;
430 430
 				} ?>
431
-                <label class="give-hidden" for="give-amount"><?php esc_html_e( 'Donation Amount:', 'give' ); ?></label>
431
+                <label class="give-hidden" for="give-amount"><?php esc_html_e('Donation Amount:', 'give'); ?></label>
432 432
                 <input class="give-text-input give-amount-top" id="give-amount" name="give-amount" type="tel"
433 433
                        placeholder="" value="<?php echo $default_amount; ?>" autocomplete="off">
434
-				<?php if ( $currency_position == 'after' ) {
434
+				<?php if ($currency_position == 'after') {
435 435
 					echo $currency_output;
436 436
 				} ?>
437 437
             </div>
@@ -446,16 +446,16 @@  discard block
 block discarded – undo
446 446
 	 * @param int $form_id The form ID.
447 447
 	 * @param array $args An array of form arguments.
448 448
 	 */
449
-	do_action( 'give_after_donation_amount', $form_id, $args );
449
+	do_action('give_after_donation_amount', $form_id, $args);
450 450
 
451 451
 	//Custom Amount Text
452
-	if ( ! $variable_pricing && give_is_setting_enabled( $allow_custom_amount ) && ! empty( $custom_amount_text ) ) { ?>
452
+	if ( ! $variable_pricing && give_is_setting_enabled($allow_custom_amount) && ! empty($custom_amount_text)) { ?>
453 453
         <p class="give-custom-amount-text"><?php echo $custom_amount_text; ?></p>
454 454
 	<?php }
455 455
 
456 456
 	//Output Variable Pricing Levels.
457
-	if ( $variable_pricing ) {
458
-		give_output_levels( $form_id );
457
+	if ($variable_pricing) {
458
+		give_output_levels($form_id);
459 459
 	}
460 460
 
461 461
 	/**
@@ -466,10 +466,10 @@  discard block
 block discarded – undo
466 466
 	 * @param int $form_id The form ID.
467 467
 	 * @param array $args An array of form arguments.
468 468
 	 */
469
-	do_action( 'give_after_donation_levels', $form_id, $args );
469
+	do_action('give_after_donation_levels', $form_id, $args);
470 470
 }
471 471
 
472
-add_action( 'give_donation_form_top', 'give_output_donation_amount_top', 10, 2 );
472
+add_action('give_donation_form_top', 'give_output_donation_amount_top', 10, 2);
473 473
 
474 474
 /**
475 475
  * Outputs the Donation Levels in various formats such as dropdown, radios, and buttons.
@@ -480,30 +480,30 @@  discard block
 block discarded – undo
480 480
  *
481 481
  * @return string Donation levels.
482 482
  */
483
-function give_output_levels( $form_id ) {
483
+function give_output_levels($form_id) {
484 484
 
485 485
 	//Get variable pricing.
486
-	$prices             = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
487
-	$display_style      = give_get_meta( $form_id, '_give_display_style', true );
488
-	$custom_amount      = give_get_meta( $form_id, '_give_custom_amount', true );
489
-	$custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true );
490
-	if ( empty( $custom_amount_text ) ) {
491
-		$custom_amount_text = esc_html__( 'Give a Custom Amount', 'give' );
486
+	$prices             = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id);
487
+	$display_style      = give_get_meta($form_id, '_give_display_style', true);
488
+	$custom_amount      = give_get_meta($form_id, '_give_custom_amount', true);
489
+	$custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true);
490
+	if (empty($custom_amount_text)) {
491
+		$custom_amount_text = esc_html__('Give a Custom Amount', 'give');
492 492
 	}
493 493
 
494 494
 	$output = '';
495 495
 
496
-	switch ( $display_style ) {
496
+	switch ($display_style) {
497 497
 		case 'buttons':
498 498
 
499 499
 			$output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">';
500 500
 
501
-			foreach ( $prices as $price ) {
502
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price );
503
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-' . $price['_give_id']['level_id'] . ' ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'give-default-level' : '' ), $form_id, $price );
501
+			foreach ($prices as $price) {
502
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price);
503
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-'.$price['_give_id']['level_id'].' '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'give-default-level' : ''), $form_id, $price);
504 504
 
505 505
 				$output .= '<li>';
506
-				$output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">';
506
+				$output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">';
507 507
 				$output .= $level_text;
508 508
 				$output .= '</button>';
509 509
 				$output .= '</li>';
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			}
512 512
 
513 513
 			//Custom Amount.
514
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
514
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
515 515
 				$output .= '<li>';
516 516
 				$output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">';
517 517
 				$output .= $custom_amount_text;
@@ -527,22 +527,22 @@  discard block
 block discarded – undo
527 527
 
528 528
 			$output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">';
529 529
 
530
-			foreach ( $prices as $price ) {
531
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price );
532
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
530
+			foreach ($prices as $price) {
531
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price);
532
+				$level_classes = apply_filters('give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-'.$price['_give_id']['level_id'].((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price);
533 533
 
534 534
 				$output .= '<li>';
535
-				$output .= '<input type="radio" data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" name="give-radio-donation-level" id="give-radio-level-' . $price['_give_id']['level_id'] . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'checked="checked"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">';
536
-				$output .= '<label for="give-radio-level-' . $price['_give_id']['level_id'] . '">' . $level_text . '</label>';
535
+				$output .= '<input type="radio" data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" name="give-radio-donation-level" id="give-radio-level-'.$price['_give_id']['level_id'].'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'checked="checked"' : '').' value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">';
536
+				$output .= '<label for="give-radio-level-'.$price['_give_id']['level_id'].'">'.$level_text.'</label>';
537 537
 				$output .= '</li>';
538 538
 
539 539
 			}
540 540
 
541 541
 			//Custom Amount.
542
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
542
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
543 543
 				$output .= '<li>';
544 544
 				$output .= '<input type="radio" data-price-id="custom" class="give-radio-input give-radio-input-level give-radio-level-custom" name="give-radio-donation-level" id="give-radio-level-custom" value="custom">';
545
-				$output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>';
545
+				$output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>';
546 546
 				$output .= '</li>';
547 547
 			}
548 548
 
@@ -552,23 +552,23 @@  discard block
 block discarded – undo
552 552
 
553 553
 		case 'dropdown':
554 554
 
555
-			$output .= '<label for="give-donation-level-select-' . $form_id . '" class="give-hidden">' . esc_html__( 'Choose Your Donation Amount', 'give' ) . ':</label>';
556
-			$output .= '<select id="give-donation-level-select-' . $form_id . '" class="give-select give-select-level give-donation-levels-wrap">';
555
+			$output .= '<label for="give-donation-level-select-'.$form_id.'" class="give-hidden">'.esc_html__('Choose Your Donation Amount', 'give').':</label>';
556
+			$output .= '<select id="give-donation-level-select-'.$form_id.'" class="give-select give-select-level give-donation-levels-wrap">';
557 557
 
558 558
 			//first loop through prices.
559
-			foreach ( $prices as $price ) {
560
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price );
561
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
559
+			foreach ($prices as $price) {
560
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price);
561
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$price['_give_id']['level_id'].((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price);
562 562
 
563
-				$output .= '<option data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'selected="selected"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">';
563
+				$output .= '<option data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'selected="selected"' : '').' value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">';
564 564
 				$output .= $level_text;
565 565
 				$output .= '</option>';
566 566
 
567 567
 			}
568 568
 
569 569
 			//Custom Amount.
570
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
571
-				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>';
570
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
571
+				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>';
572 572
 			}
573 573
 
574 574
 			$output .= '</select>';
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			break;
577 577
 	}
578 578
 
579
-	echo apply_filters( 'give_form_level_output', $output, $form_id );
579
+	echo apply_filters('give_form_level_output', $output, $form_id);
580 580
 }
581 581
 
582 582
 /**
@@ -591,27 +591,27 @@  discard block
 block discarded – undo
591 591
  *
592 592
  * @return string Checkout button.
593 593
  */
594
-function give_display_checkout_button( $form_id, $args ) {
594
+function give_display_checkout_button($form_id, $args) {
595 595
 
596
-	$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )
596
+	$display_option = (isset($args['display_style']) && ! empty($args['display_style']))
597 597
 		? $args['display_style']
598
-		: give_get_meta( $form_id, '_give_payment_display', true );
598
+		: give_get_meta($form_id, '_give_payment_display', true);
599 599
 
600
-	if ( 'button' === $display_option ) {
600
+	if ('button' === $display_option) {
601 601
 		$display_option = 'modal';
602
-	} elseif ( $display_option === 'onpage' ) {
602
+	} elseif ($display_option === 'onpage') {
603 603
 		return '';
604 604
 	}
605 605
 
606
-	$display_label_field = give_get_meta( $form_id, '_give_reveal_label', true );
607
-	$display_label       = ! empty( $args['continue_button_title'] ) ? $args['continue_button_title'] : ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );
606
+	$display_label_field = give_get_meta($form_id, '_give_reveal_label', true);
607
+	$display_label       = ! empty($args['continue_button_title']) ? $args['continue_button_title'] : ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give'));
608 608
 
609
-	$output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>';
609
+	$output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>';
610 610
 
611
-	echo apply_filters( 'give_display_checkout_button', $output );
611
+	echo apply_filters('give_display_checkout_button', $output);
612 612
 }
613 613
 
614
-add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 );
614
+add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2);
615 615
 
616 616
 /**
617 617
  * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided.
@@ -622,57 +622,57 @@  discard block
 block discarded – undo
622 622
  *
623 623
  * @return void
624 624
  */
625
-function give_user_info_fields( $form_id ) {
625
+function give_user_info_fields($form_id) {
626 626
 	// Get user info.
627
-	$give_user_info = _give_get_prefill_form_field_values( $form_id );
627
+	$give_user_info = _give_get_prefill_form_field_values($form_id);
628 628
 
629 629
 	/**
630 630
 	 * Fire before user personal information fields
631 631
 	 *
632 632
 	 * @since 1.7
633 633
 	 */
634
-	do_action( 'give_donation_form_before_personal_info', $form_id );
634
+	do_action('give_donation_form_before_personal_info', $form_id);
635 635
 	?>
636 636
     <fieldset id="give_checkout_user_info">
637
-        <legend><?php echo apply_filters( 'give_checkout_personal_info_text', esc_html__( 'Personal Info', 'give' ) ); ?></legend>
637
+        <legend><?php echo apply_filters('give_checkout_personal_info_text', esc_html__('Personal Info', 'give')); ?></legend>
638 638
         <p id="give-first-name-wrap" class="form-row form-row-first form-row-responsive">
639 639
             <label class="give-label" for="give-first">
640
-				<?php esc_html_e( 'First Name', 'give' ); ?>
641
-				<?php if ( give_field_is_required( 'give_first', $form_id ) ) : ?>
640
+				<?php esc_html_e('First Name', 'give'); ?>
641
+				<?php if (give_field_is_required('give_first', $form_id)) : ?>
642 642
                     <span class="give-required-indicator">*</span>
643 643
 				<?php endif ?>
644 644
                 <span class="give-tooltip give-icon give-icon-question"
645
-                      data-tooltip="<?php esc_attr_e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span>
645
+                      data-tooltip="<?php esc_attr_e('We will use this to personalize your account experience.', 'give'); ?>"></span>
646 646
             </label>
647 647
             <input
648 648
                     class="give-input required"
649 649
                     type="text"
650 650
                     name="give_first"
651
-                    placeholder="<?php esc_attr_e( 'First Name', 'give' ); ?>"
651
+                    placeholder="<?php esc_attr_e('First Name', 'give'); ?>"
652 652
                     id="give-first"
653
-                    value="<?php echo isset( $give_user_info['give_first'] ) ? $give_user_info['give_first'] : ''; ?>"
654
-				<?php echo( give_field_is_required( 'give_first', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
653
+                    value="<?php echo isset($give_user_info['give_first']) ? $give_user_info['give_first'] : ''; ?>"
654
+				<?php echo(give_field_is_required('give_first', $form_id) ? ' required aria-required="true" ' : ''); ?>
655 655
             />
656 656
         </p>
657 657
 
658 658
         <p id="give-last-name-wrap" class="form-row form-row-last form-row-responsive">
659 659
             <label class="give-label" for="give-last">
660
-				<?php esc_html_e( 'Last Name', 'give' ); ?>
661
-				<?php if ( give_field_is_required( 'give_last', $form_id ) ) : ?>
660
+				<?php esc_html_e('Last Name', 'give'); ?>
661
+				<?php if (give_field_is_required('give_last', $form_id)) : ?>
662 662
                     <span class="give-required-indicator">*</span>
663 663
 				<?php endif ?>
664 664
                 <span class="give-tooltip give-icon give-icon-question"
665
-                      data-tooltip="<?php esc_attr_e( 'We will use this as well to personalize your account experience.', 'give' ); ?>"></span>
665
+                      data-tooltip="<?php esc_attr_e('We will use this as well to personalize your account experience.', 'give'); ?>"></span>
666 666
             </label>
667 667
 
668 668
             <input
669
-                    class="give-input<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required' : '' ); ?>"
669
+                    class="give-input<?php echo(give_field_is_required('give_last', $form_id) ? ' required' : ''); ?>"
670 670
                     type="text"
671 671
                     name="give_last"
672 672
                     id="give-last"
673
-                    placeholder="<?php esc_attr_e( 'Last Name', 'give' ); ?>"
674
-                    value="<?php echo isset( $give_user_info['give_last'] ) ? $give_user_info['give_last'] : ''; ?>"
675
-				<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
673
+                    placeholder="<?php esc_attr_e('Last Name', 'give'); ?>"
674
+                    value="<?php echo isset($give_user_info['give_last']) ? $give_user_info['give_last'] : ''; ?>"
675
+				<?php echo(give_field_is_required('give_last', $form_id) ? ' required aria-required="true" ' : ''); ?>
676 676
             />
677 677
         </p>
678 678
 
@@ -682,26 +682,26 @@  discard block
 block discarded – undo
682 682
 		 *
683 683
 		 * @since 1.7
684 684
 		 */
685
-		do_action( 'give_donation_form_before_email', $form_id );
685
+		do_action('give_donation_form_before_email', $form_id);
686 686
 		?>
687 687
         <p id="give-email-wrap" class="form-row form-row-wide">
688 688
             <label class="give-label" for="give-email">
689
-				<?php esc_html_e( 'Email Address', 'give' ); ?>
690
-				<?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?>
689
+				<?php esc_html_e('Email Address', 'give'); ?>
690
+				<?php if (give_field_is_required('give_email', $form_id)) { ?>
691 691
                     <span class="give-required-indicator">*</span>
692 692
 				<?php } ?>
693 693
                 <span class="give-tooltip give-icon give-icon-question"
694
-                      data-tooltip="<?php esc_attr_e( 'We will send the donation receipt to this address.', 'give' ); ?>"></span>
694
+                      data-tooltip="<?php esc_attr_e('We will send the donation receipt to this address.', 'give'); ?>"></span>
695 695
             </label>
696 696
 
697 697
             <input
698 698
                     class="give-input required"
699 699
                     type="email"
700 700
                     name="give_email"
701
-                    placeholder="<?php esc_attr_e( 'Email Address', 'give' ); ?>"
701
+                    placeholder="<?php esc_attr_e('Email Address', 'give'); ?>"
702 702
                     id="give-email"
703
-                    value="<?php echo isset( $give_user_info['give_email'] ) ? $give_user_info['give_email'] : ''; ?>"
704
-				<?php echo( give_field_is_required( 'give_email', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
703
+                    value="<?php echo isset($give_user_info['give_email']) ? $give_user_info['give_email'] : ''; ?>"
704
+				<?php echo(give_field_is_required('give_email', $form_id) ? ' required aria-required="true" ' : ''); ?>
705 705
             />
706 706
 
707 707
         </p>
@@ -711,14 +711,14 @@  discard block
 block discarded – undo
711 711
 		 *
712 712
 		 * @since 1.7
713 713
 		 */
714
-		do_action( 'give_donation_form_after_email', $form_id );
714
+		do_action('give_donation_form_after_email', $form_id);
715 715
 
716 716
 		/**
717 717
 		 * Fire after personal email field
718 718
 		 *
719 719
 		 * @since 1.7
720 720
 		 */
721
-		do_action( 'give_donation_form_user_info', $form_id );
721
+		do_action('give_donation_form_user_info', $form_id);
722 722
 		?>
723 723
     </fieldset>
724 724
 	<?php
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
 	 *
728 728
 	 * @since 1.7
729 729
 	 */
730
-	do_action( 'give_donation_form_after_personal_info', $form_id );
730
+	do_action('give_donation_form_after_personal_info', $form_id);
731 731
 }
732 732
 
733
-add_action( 'give_donation_form_after_user_info', 'give_user_info_fields' );
734
-add_action( 'give_register_fields_before', 'give_user_info_fields' );
733
+add_action('give_donation_form_after_user_info', 'give_user_info_fields');
734
+add_action('give_register_fields_before', 'give_user_info_fields');
735 735
 
736 736
 /**
737 737
  * Renders the credit card info form.
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
  *
743 743
  * @return void
744 744
  */
745
-function give_get_cc_form( $form_id ) {
745
+function give_get_cc_form($form_id) {
746 746
 
747 747
 	ob_start();
748 748
 
@@ -753,53 +753,53 @@  discard block
 block discarded – undo
753 753
 	 *
754 754
 	 * @param int $form_id The form ID.
755 755
 	 */
756
-	do_action( 'give_before_cc_fields', $form_id );
756
+	do_action('give_before_cc_fields', $form_id);
757 757
 	?>
758 758
     <fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate">
759
-        <legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html__( 'Credit Card Info', 'give' ) ); ?></legend>
760
-		<?php if ( is_ssl() ) : ?>
759
+        <legend><?php echo apply_filters('give_credit_card_fieldset_heading', esc_html__('Credit Card Info', 'give')); ?></legend>
760
+		<?php if (is_ssl()) : ?>
761 761
             <div id="give_secure_site_wrapper-<?php echo $form_id ?>">
762 762
                 <span class="give-icon padlock"></span>
763
-                <span><?php esc_html_e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>
763
+                <span><?php esc_html_e('This is a secure SSL encrypted payment.', 'give'); ?></span>
764 764
             </div>
765 765
 		<?php endif; ?>
766 766
         <p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds form-row-responsive">
767 767
             <label for="card_number-<?php echo $form_id ?>" class="give-label">
768
-				<?php esc_html_e( 'Card Number', 'give' ); ?>
768
+				<?php esc_html_e('Card Number', 'give'); ?>
769 769
                 <span class="give-required-indicator">*</span>
770 770
                 <span class="give-tooltip give-icon give-icon-question"
771
-                      data-tooltip="<?php esc_attr_e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span>
771
+                      data-tooltip="<?php esc_attr_e('The (typically) 16 digits on the front of your credit card.', 'give'); ?>"></span>
772 772
                 <span class="card-type"></span>
773 773
             </label>
774 774
 
775 775
             <input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>"
776
-                   class="card-number give-input required" placeholder="<?php esc_attr_e( 'Card number', 'give' ); ?>"
776
+                   class="card-number give-input required" placeholder="<?php esc_attr_e('Card number', 'give'); ?>"
777 777
                    required aria-required="true"/>
778 778
         </p>
779 779
 
780 780
         <p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third form-row-responsive">
781 781
             <label for="card_cvc-<?php echo $form_id ?>" class="give-label">
782
-				<?php esc_html_e( 'CVC', 'give' ); ?>
782
+				<?php esc_html_e('CVC', 'give'); ?>
783 783
                 <span class="give-required-indicator">*</span>
784 784
                 <span class="give-tooltip give-icon give-icon-question"
785
-                      data-tooltip="<?php esc_attr_e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ); ?>"></span>
785
+                      data-tooltip="<?php esc_attr_e('The 3 digit (back) or 4 digit (front) value on your card.', 'give'); ?>"></span>
786 786
             </label>
787 787
 
788 788
             <input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>"
789
-                   class="card-cvc give-input required" placeholder="<?php esc_attr_e( 'Security code', 'give' ); ?>"
789
+                   class="card-cvc give-input required" placeholder="<?php esc_attr_e('Security code', 'give'); ?>"
790 790
                    required aria-required="true"/>
791 791
         </p>
792 792
 
793 793
         <p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds form-row-responsive">
794 794
             <label for="card_name-<?php echo $form_id ?>" class="give-label">
795
-				<?php esc_html_e( 'Name on the Card', 'give' ); ?>
795
+				<?php esc_html_e('Name on the Card', 'give'); ?>
796 796
                 <span class="give-required-indicator">*</span>
797 797
                 <span class="give-tooltip give-icon give-icon-question"
798
-                      data-tooltip="<?php esc_attr_e( 'The name printed on the front of your credit card.', 'give' ); ?>"></span>
798
+                      data-tooltip="<?php esc_attr_e('The name printed on the front of your credit card.', 'give'); ?>"></span>
799 799
             </label>
800 800
 
801 801
             <input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>"
802
-                   class="card-name give-input required" placeholder="<?php esc_attr_e( 'Card name', 'give' ); ?>"
802
+                   class="card-name give-input required" placeholder="<?php esc_attr_e('Card name', 'give'); ?>"
803 803
                    required aria-required="true"/>
804 804
         </p>
805 805
 		<?php
@@ -810,14 +810,14 @@  discard block
 block discarded – undo
810 810
 		 *
811 811
 		 * @param int $form_id The form ID.
812 812
 		 */
813
-		do_action( 'give_before_cc_expiration' );
813
+		do_action('give_before_cc_expiration');
814 814
 		?>
815 815
         <p class="card-expiration form-row form-row-one-third form-row-responsive">
816 816
             <label for="card_expiry-<?php echo $form_id ?>" class="give-label">
817
-				<?php esc_html_e( 'Expiration', 'give' ); ?>
817
+				<?php esc_html_e('Expiration', 'give'); ?>
818 818
                 <span class="give-required-indicator">*</span>
819 819
                 <span class="give-tooltip give-icon give-icon-question"
820
-                      data-tooltip="<?php esc_attr_e( 'The date your credit card expires, typically on the front of the card.', 'give' ); ?>"></span>
820
+                      data-tooltip="<?php esc_attr_e('The date your credit card expires, typically on the front of the card.', 'give'); ?>"></span>
821 821
             </label>
822 822
 
823 823
             <input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month"
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
                    class="card-expiry-year"/>
827 827
 
828 828
             <input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>"
829
-                   class="card-expiry give-input required" placeholder="<?php esc_attr_e( 'MM / YY', 'give' ); ?>"
829
+                   class="card-expiry give-input required" placeholder="<?php esc_attr_e('MM / YY', 'give'); ?>"
830 830
                    required aria-required="true"/>
831 831
         </p>
832 832
 		<?php
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 		 *
838 838
 		 * @param int $form_id The form ID.
839 839
 		 */
840
-		do_action( 'give_after_cc_expiration', $form_id );
840
+		do_action('give_after_cc_expiration', $form_id);
841 841
 		?>
842 842
     </fieldset>
843 843
 	<?php
@@ -848,12 +848,12 @@  discard block
 block discarded – undo
848 848
 	 *
849 849
 	 * @param int $form_id The form ID.
850 850
 	 */
851
-	do_action( 'give_after_cc_fields', $form_id );
851
+	do_action('give_after_cc_fields', $form_id);
852 852
 
853 853
 	echo ob_get_clean();
854 854
 }
855 855
 
856
-add_action( 'give_cc_form', 'give_get_cc_form' );
856
+add_action('give_cc_form', 'give_get_cc_form');
857 857
 
858 858
 /**
859 859
  * Outputs the default credit card address fields.
@@ -864,24 +864,24 @@  discard block
 block discarded – undo
864 864
  *
865 865
  * @return void
866 866
  */
867
-function give_default_cc_address_fields( $form_id ) {
867
+function give_default_cc_address_fields($form_id) {
868 868
 	// Get user info.
869
-	$give_user_info = _give_get_prefill_form_field_values( $form_id );
869
+	$give_user_info = _give_get_prefill_form_field_values($form_id);
870 870
 
871 871
 	$logged_in = is_user_logged_in();
872 872
 
873
-	if ( $logged_in ) {
874
-		$user_address = get_user_meta( get_current_user_id(), '_give_user_address', true );
873
+	if ($logged_in) {
874
+		$user_address = get_user_meta(get_current_user_id(), '_give_user_address', true);
875 875
 	}
876
-	$line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : '';
877
-	$line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : '';
878
-	$city  = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : '';
879
-	$zip   = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : '';
876
+	$line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : '';
877
+	$line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : '';
878
+	$city  = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : '';
879
+	$zip   = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : '';
880 880
 
881 881
 	ob_start();
882 882
 	?>
883 883
     <fieldset id="give_cc_address" class="cc-address">
884
-        <legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>
884
+        <legend><?php echo apply_filters('give_billing_details_fieldset_heading', esc_html__('Billing Details', 'give')); ?></legend>
885 885
 		<?php
886 886
 		/**
887 887
 		 * Fires while rendering credit card billing form, before address fields.
@@ -890,38 +890,38 @@  discard block
 block discarded – undo
890 890
 		 *
891 891
 		 * @param int $form_id The form ID.
892 892
 		 */
893
-		do_action( 'give_cc_billing_top' );
893
+		do_action('give_cc_billing_top');
894 894
 
895 895
 
896 896
 
897 897
 		// For Country.
898 898
 		$selected_country = give_get_country();
899
-		if ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {
899
+		if ( ! empty($give_user_info['billing_country']) && '*' !== $give_user_info['billing_country']) {
900 900
 			$selected_country = $give_user_info['billing_country'];
901 901
 		}
902 902
 		$countries = give_get_country_list();
903 903
 
904 904
 		// For state
905 905
 		$selected_state = '';
906
-		if ( $selected_country === give_get_country() ) {
906
+		if ($selected_country === give_get_country()) {
907 907
 			// Get defalut selected state by admin.
908 908
 			$selected_state = give_get_state();
909 909
 		}
910 910
 		// Get the last payment made by user states.
911
-		if ( ! empty( $give_user_info['card_state'] ) && '*' !== $give_user_info['card_state'] ) {
911
+		if ( ! empty($give_user_info['card_state']) && '*' !== $give_user_info['card_state']) {
912 912
 			$selected_state = $give_user_info['card_state'];
913 913
 		}
914 914
 		// Get the country code
915
-		if ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {
915
+		if ( ! empty($give_user_info['billing_country']) && '*' !== $give_user_info['billing_country']) {
916 916
 			$selected_country = $give_user_info['billing_country'];
917 917
 		}
918
-		$label        = __( 'State', 'give' );
918
+		$label        = __('State', 'give');
919 919
 		$states_label = give_get_states_label();
920 920
 		// Check if $country code exists in the array key for states label.
921
-		if ( array_key_exists( $selected_country, $states_label ) ) {
922
-			$label = $states_label[ $selected_country ];
921
+		if (array_key_exists($selected_country, $states_label)) {
922
+			$label = $states_label[$selected_country];
923 923
 		}
924
-		$states = give_get_states( $selected_country );
924
+		$states = give_get_states($selected_country);
925 925
 		// Get the country list that do not have any states init.
926 926
 		$no_states_country = give_no_states_country_list();
927 927
 		// Get the country list that does not require states.
@@ -930,23 +930,23 @@  discard block
 block discarded – undo
930 930
 		?>
931 931
 	    <p id="give-card-country-wrap" class="form-row form-row-wide">
932 932
 		    <label for="billing_country" class="give-label">
933
-			    <?php esc_html_e( 'Country', 'give' ); ?>
934
-			    <?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>
933
+			    <?php esc_html_e('Country', 'give'); ?>
934
+			    <?php if (give_field_is_required('billing_country', $form_id)) : ?>
935 935
 				    <span class="give-required-indicator">*</span>
936 936
 			    <?php endif; ?>
937 937
 			    <span class="give-tooltip give-icon give-icon-question"
938
-			          data-tooltip="<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>"></span>
938
+			          data-tooltip="<?php esc_attr_e('The country for your billing address.', 'give'); ?>"></span>
939 939
 		    </label>
940 940
 
941 941
 		    <select
942 942
 				    name="billing_country"
943 943
 				    id="billing_country"
944
-				    class="billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>"
945
-			    <?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
944
+				    class="billing-country billing_country give-select<?php echo(give_field_is_required('billing_country', $form_id) ? ' required' : ''); ?>"
945
+			    <?php echo(give_field_is_required('billing_country', $form_id) ? ' required aria-required="true" ' : ''); ?>
946 946
 		    >
947 947
 			    <?php
948
-			    foreach ( $countries as $country_code => $country ) {
949
-				    echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
948
+			    foreach ($countries as $country_code => $country) {
949
+				    echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
950 950
 			    }
951 951
 			    ?>
952 952
 		    </select>
@@ -954,69 +954,69 @@  discard block
 block discarded – undo
954 954
 
955 955
 	    <p id="give-card-address-wrap" class="form-row form-row-wide">
956 956
 		    <label for="card_address" class="give-label">
957
-			    <?php esc_html_e( 'Address 1', 'give' ); ?>
957
+			    <?php esc_html_e('Address 1', 'give'); ?>
958 958
 			    <?php
959
-			    if ( give_field_is_required( 'card_address', $form_id ) ) : ?>
959
+			    if (give_field_is_required('card_address', $form_id)) : ?>
960 960
 				    <span class="give-required-indicator">*</span>
961 961
 			    <?php endif; ?>
962 962
 			    <span class="give-tooltip give-icon give-icon-question"
963
-			          data-tooltip="<?php esc_attr_e( 'The primary billing address for your credit card.', 'give' ); ?>"></span>
963
+			          data-tooltip="<?php esc_attr_e('The primary billing address for your credit card.', 'give'); ?>"></span>
964 964
 		    </label>
965 965
 
966 966
 		    <input
967 967
 				    type="text"
968 968
 				    id="card_address"
969 969
 				    name="card_address"
970
-				    class="card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>"
971
-				    placeholder="<?php esc_attr_e( 'Address line 1', 'give' ); ?>"
972
-				    value="<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>"
973
-			    <?php echo( give_field_is_required( 'card_address', $form_id ) ? '  required aria-required="true" ' : '' ); ?>
970
+				    class="card-address give-input<?php echo(give_field_is_required('card_address', $form_id) ? ' required' : ''); ?>"
971
+				    placeholder="<?php esc_attr_e('Address line 1', 'give'); ?>"
972
+				    value="<?php echo isset($give_user_info['card_address']) ? $give_user_info['card_address'] : ''; ?>"
973
+			    <?php echo(give_field_is_required('card_address', $form_id) ? '  required aria-required="true" ' : ''); ?>
974 974
 		    />
975 975
 	    </p>
976 976
 
977 977
 	    <p id="give-card-address-2-wrap" class="form-row form-row-wide">
978 978
 		    <label for="card_address_2" class="give-label">
979
-			    <?php esc_html_e( 'Address 2', 'give' ); ?>
980
-			    <?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>
979
+			    <?php esc_html_e('Address 2', 'give'); ?>
980
+			    <?php if (give_field_is_required('card_address_2', $form_id)) : ?>
981 981
 				    <span class="give-required-indicator">*</span>
982 982
 			    <?php endif; ?>
983 983
 			    <span class="give-tooltip give-icon give-icon-question"
984
-			          data-tooltip="<?php esc_attr_e( '(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give' ); ?>"></span>
984
+			          data-tooltip="<?php esc_attr_e('(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give'); ?>"></span>
985 985
 		    </label>
986 986
 
987 987
 		    <input
988 988
 				    type="text"
989 989
 				    id="card_address_2"
990 990
 				    name="card_address_2"
991
-				    class="card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>"
992
-				    placeholder="<?php esc_attr_e( 'Address line 2', 'give' ); ?>"
993
-				    value="<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>"
994
-			    <?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
991
+				    class="card-address-2 give-input<?php echo(give_field_is_required('card_address_2', $form_id) ? ' required' : ''); ?>"
992
+				    placeholder="<?php esc_attr_e('Address line 2', 'give'); ?>"
993
+				    value="<?php echo isset($give_user_info['card_address_2']) ? $give_user_info['card_address_2'] : ''; ?>"
994
+			    <?php echo(give_field_is_required('card_address_2', $form_id) ? ' required aria-required="true" ' : ''); ?>
995 995
 		    />
996 996
 	    </p>
997 997
 
998 998
 	    <p id="give-card-state-wrap"
999
-	       class="form-row form-row-wide <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ) ? 'give-hidden' : ''; ?> ">
999
+	       class="form-row form-row-wide <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country)) ? 'give-hidden' : ''; ?> ">
1000 1000
 		    <label for="card_state" class="give-label">
1001 1001
 			    <span class="state-label-text"><?php echo $label; ?></span>
1002
-			    <?php if ( give_field_is_required( 'card_state', $form_id ) ) :
1002
+			    <?php if (give_field_is_required('card_state', $form_id)) :
1003 1003
 				    ?>
1004
-				    <span class="give-required-indicator <?php echo( array_key_exists( $selected_country, $states_not_required_country_list ) ? 'give-hidden' : '' ) ?> ">*</span>
1004
+				    <span class="give-required-indicator <?php echo(array_key_exists($selected_country, $states_not_required_country_list) ? 'give-hidden' : '') ?> ">*</span>
1005 1005
 			    <?php endif; ?>
1006 1006
 			    <span class="give-tooltip give-icon give-icon-question"
1007
-			          data-tooltip="<?php esc_attr_e( 'The state, province, or county for your billing address.', 'give' ); ?>"></span>
1007
+			          data-tooltip="<?php esc_attr_e('The state, province, or county for your billing address.', 'give'); ?>"></span>
1008 1008
 		    </label>
1009 1009
 		    <?php
1010 1010
 
1011
-		    if ( ! empty( $states ) ) : ?>
1011
+		    if ( ! empty($states)) : ?>
1012 1012
 			    <select
1013 1013
 					    name="card_state"
1014 1014
 					    id="card_state"
1015
-					    class="card_state give-select<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required' : '' ); ?>"
1016
-				    <?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required aria-required="true" ' : '' ); ?>>
1015
+					    class="card_state give-select<?php echo(give_field_is_required('card_state', $form_id) ? ' required' : ''); ?>"
1016
+				    <?php echo(give_field_is_required('card_state', $form_id) ? ' required aria-required="true" ' : ''); ?>>
1017 1017
 				    <?php
1018
-				    foreach ( $states as $state_code => $state ) {
1019
-					    echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
1018
+				    foreach ($states as $state_code => $state) {
1019
+					    echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
1020 1020
 				    }
1021 1021
 				    ?>
1022 1022
 			    </select>
@@ -1028,32 +1028,32 @@  discard block
 block discarded – undo
1028 1028
 
1029 1029
 	    <p id="give-card-city-wrap" class="form-row form-row-first form-row-responsive">
1030 1030
 		    <label for="card_city" class="give-label">
1031
-			    <?php esc_html_e( 'City', 'give' ); ?>
1032
-			    <?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>
1031
+			    <?php esc_html_e('City', 'give'); ?>
1032
+			    <?php if (give_field_is_required('card_city', $form_id)) : ?>
1033 1033
 				    <span class="give-required-indicator">*</span>
1034 1034
 			    <?php endif; ?>
1035 1035
 			    <span class="give-tooltip give-icon give-icon-question"
1036
-			          data-tooltip="<?php esc_attr_e( 'The city for your billing address.', 'give' ); ?>"></span>
1036
+			          data-tooltip="<?php esc_attr_e('The city for your billing address.', 'give'); ?>"></span>
1037 1037
 		    </label>
1038 1038
 		    <input
1039 1039
 				    type="text"
1040 1040
 				    id="card_city"
1041 1041
 				    name="card_city"
1042
-				    class="card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>"
1043
-				    placeholder="<?php esc_attr_e( 'City', 'give' ); ?>"
1044
-				    value="<?php echo isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : ''; ?>"
1045
-			    <?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
1042
+				    class="card-city give-input<?php echo(give_field_is_required('card_city', $form_id) ? ' required' : ''); ?>"
1043
+				    placeholder="<?php esc_attr_e('City', 'give'); ?>"
1044
+				    value="<?php echo isset($give_user_info['card_city']) ? $give_user_info['card_city'] : ''; ?>"
1045
+			    <?php echo(give_field_is_required('card_city', $form_id) ? ' required aria-required="true" ' : ''); ?>
1046 1046
 		    />
1047 1047
 	    </p>
1048 1048
 
1049 1049
 	    <p id="give-card-zip-wrap" class="form-row form-row-last form-row-responsive">
1050 1050
 		    <label for="card_zip" class="give-label">
1051
-			    <?php esc_html_e( 'Zip / Postal Code', 'give' ); ?>
1052
-			    <?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>
1051
+			    <?php esc_html_e('Zip / Postal Code', 'give'); ?>
1052
+			    <?php if (give_field_is_required('card_zip', $form_id)) : ?>
1053 1053
 				    <span class="give-required-indicator">*</span>
1054 1054
 			    <?php endif; ?>
1055 1055
 			    <span class="give-tooltip give-icon give-icon-question"
1056
-			          data-tooltip="<?php esc_attr_e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span>
1056
+			          data-tooltip="<?php esc_attr_e('The zip or postal code for your billing address.', 'give'); ?>"></span>
1057 1057
 		    </label>
1058 1058
 
1059 1059
 		    <input
@@ -1061,10 +1061,10 @@  discard block
 block discarded – undo
1061 1061
 				    size="4"
1062 1062
 				    id="card_zip"
1063 1063
 				    name="card_zip"
1064
-				    class="card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>"
1065
-				    placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>"
1066
-				    value="<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>"
1067
-			    <?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
1064
+				    class="card-zip give-input<?php echo(give_field_is_required('card_zip', $form_id) ? ' required' : ''); ?>"
1065
+				    placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>"
1066
+				    value="<?php echo isset($give_user_info['card_zip']) ? $give_user_info['card_zip'] : ''; ?>"
1067
+			    <?php echo(give_field_is_required('card_zip', $form_id) ? ' required aria-required="true" ' : ''); ?>
1068 1068
 		    />
1069 1069
 	    </p>
1070 1070
 		<?php
@@ -1075,14 +1075,14 @@  discard block
 block discarded – undo
1075 1075
 		 *
1076 1076
 		 * @param int $form_id The form ID.
1077 1077
 		 */
1078
-		do_action( 'give_cc_billing_bottom' );
1078
+		do_action('give_cc_billing_bottom');
1079 1079
 		?>
1080 1080
     </fieldset>
1081 1081
 	<?php
1082 1082
 	echo ob_get_clean();
1083 1083
 }
1084 1084
 
1085
-add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' );
1085
+add_action('give_after_cc_fields', 'give_default_cc_address_fields');
1086 1086
 
1087 1087
 
1088 1088
 /**
@@ -1095,24 +1095,24 @@  discard block
 block discarded – undo
1095 1095
  *
1096 1096
  * @return string
1097 1097
  */
1098
-function give_get_register_fields( $form_id ) {
1098
+function give_get_register_fields($form_id) {
1099 1099
 
1100 1100
 	global $user_ID;
1101 1101
 
1102
-	if ( is_user_logged_in() ) {
1103
-		$user_data = get_userdata( $user_ID );
1102
+	if (is_user_logged_in()) {
1103
+		$user_data = get_userdata($user_ID);
1104 1104
 	}
1105 1105
 
1106
-	$show_register_form = give_show_login_register_option( $form_id );
1106
+	$show_register_form = give_show_login_register_option($form_id);
1107 1107
 
1108 1108
 	ob_start(); ?>
1109 1109
     <fieldset id="give-register-fields-<?php echo $form_id; ?>">
1110 1110
 
1111
-		<?php if ( $show_register_form == 'both' ) { ?>
1111
+		<?php if ($show_register_form == 'both') { ?>
1112 1112
             <div class="give-login-account-wrap">
1113
-                <p class="give-login-message"><?php esc_html_e( 'Already have an account?', 'give' ); ?>&nbsp;
1114
-                    <a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-login"
1115
-                       data-action="give_checkout_login"><?php esc_html_e( 'Login', 'give' ); ?></a>
1113
+                <p class="give-login-message"><?php esc_html_e('Already have an account?', 'give'); ?>&nbsp;
1114
+                    <a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-login"
1115
+                       data-action="give_checkout_login"><?php esc_html_e('Login', 'give'); ?></a>
1116 1116
                 </p>
1117 1117
                 <p class="give-loading-text">
1118 1118
                     <span class="give-loading-animation"></span>
@@ -1128,15 +1128,15 @@  discard block
 block discarded – undo
1128 1128
 		 *
1129 1129
 		 * @param int $form_id The form ID.
1130 1130
 		 */
1131
-		do_action( 'give_register_fields_before', $form_id );
1131
+		do_action('give_register_fields_before', $form_id);
1132 1132
 		?>
1133 1133
 
1134 1134
         <fieldset id="give-register-account-fields-<?php echo $form_id; ?>">
1135 1135
             <legend>
1136 1136
 				<?php
1137
-				echo apply_filters( 'give_create_account_fieldset_heading', esc_html__( 'Create an account', 'give' ) );
1138
-				if ( ! give_logged_in_only( $form_id ) ) {
1139
-					echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>';
1137
+				echo apply_filters('give_create_account_fieldset_heading', esc_html__('Create an account', 'give'));
1138
+				if ( ! give_logged_in_only($form_id)) {
1139
+					echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>';
1140 1140
 				}
1141 1141
 				?>
1142 1142
             </legend>
@@ -1148,54 +1148,54 @@  discard block
 block discarded – undo
1148 1148
 			 *
1149 1149
 			 * @param int $form_id The form ID.
1150 1150
 			 */
1151
-			do_action( 'give_register_account_fields_before', $form_id );
1151
+			do_action('give_register_account_fields_before', $form_id);
1152 1152
 			?>
1153 1153
             <div id="give-user-login-wrap-<?php echo $form_id; ?>"
1154 1154
                  class="form-row form-row-one-third form-row-first form-row-responsive">
1155 1155
                 <label for="give-user-login-<?php echo $form_id; ?>">
1156
-					<?php esc_html_e( 'Username', 'give' ); ?>
1157
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1156
+					<?php esc_html_e('Username', 'give'); ?>
1157
+					<?php if (give_logged_in_only($form_id)) { ?>
1158 1158
                         <span class="give-required-indicator">*</span>
1159 1159
 					<?php } ?>
1160 1160
                     <span class="give-tooltip give-icon give-icon-question"
1161
-                          data-tooltip="<?php esc_attr_e( 'The username you will use to log into your account.', 'give' ); ?>"></span>
1161
+                          data-tooltip="<?php esc_attr_e('The username you will use to log into your account.', 'give'); ?>"></span>
1162 1162
                 </label>
1163 1163
 
1164 1164
                 <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="give-input"
1165 1165
                        type="text"
1166
-                       placeholder="<?php esc_attr_e( 'Username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1166
+                       placeholder="<?php esc_attr_e('Username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1167 1167
             </div>
1168 1168
 
1169 1169
             <div id="give-user-pass-wrap-<?php echo $form_id; ?>"
1170 1170
                  class="form-row form-row-one-third form-row-responsive">
1171 1171
                 <label for="give-user-pass-<?php echo $form_id; ?>">
1172
-					<?php esc_html_e( 'Password', 'give' ); ?>
1173
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1172
+					<?php esc_html_e('Password', 'give'); ?>
1173
+					<?php if (give_logged_in_only($form_id)) { ?>
1174 1174
                         <span class="give-required-indicator">*</span>
1175 1175
 					<?php } ?>
1176 1176
                     <span class="give-tooltip give-icon give-icon-question"
1177
-                          data-tooltip="<?php esc_attr_e( 'The password used to access your account.', 'give' ); ?>"></span>
1177
+                          data-tooltip="<?php esc_attr_e('The password used to access your account.', 'give'); ?>"></span>
1178 1178
                 </label>
1179 1179
 
1180 1180
                 <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="give-input"
1181
-                       placeholder="<?php esc_attr_e( 'Password', 'give' ); ?>"
1182
-                       type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1181
+                       placeholder="<?php esc_attr_e('Password', 'give'); ?>"
1182
+                       type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1183 1183
             </div>
1184 1184
 
1185 1185
             <div id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>"
1186 1186
                  class="give-register-password form-row form-row-one-third form-row-responsive">
1187 1187
                 <label for="give-user-pass-confirm-<?php echo $form_id; ?>">
1188
-					<?php esc_html_e( 'Confirm PW', 'give' ); ?>
1189
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1188
+					<?php esc_html_e('Confirm PW', 'give'); ?>
1189
+					<?php if (give_logged_in_only($form_id)) { ?>
1190 1190
                         <span class="give-required-indicator">*</span>
1191 1191
 					<?php } ?>
1192 1192
                     <span class="give-tooltip give-icon give-icon-question"
1193
-                          data-tooltip="<?php esc_attr_e( 'Please retype your password to confirm.', 'give' ); ?>"></span>
1193
+                          data-tooltip="<?php esc_attr_e('Please retype your password to confirm.', 'give'); ?>"></span>
1194 1194
                 </label>
1195 1195
 
1196 1196
                 <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>"
1197
-                       class="give-input" placeholder="<?php esc_attr_e( 'Confirm password', 'give' ); ?>"
1198
-                       type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1197
+                       class="give-input" placeholder="<?php esc_attr_e('Confirm password', 'give'); ?>"
1198
+                       type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1199 1199
             </div>
1200 1200
 			<?php
1201 1201
 			/**
@@ -1205,7 +1205,7 @@  discard block
 block discarded – undo
1205 1205
 			 *
1206 1206
 			 * @param int $form_id The form ID.
1207 1207
 			 */
1208
-			do_action( 'give_register_account_fields_after', $form_id );
1208
+			do_action('give_register_account_fields_after', $form_id);
1209 1209
 			?>
1210 1210
         </fieldset>
1211 1211
 
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 		 *
1218 1218
 		 * @param int $form_id The form ID.
1219 1219
 		 */
1220
-		do_action( 'give_register_fields_after', $form_id );
1220
+		do_action('give_register_fields_after', $form_id);
1221 1221
 		?>
1222 1222
 
1223 1223
         <input type="hidden" name="give-purchase-var" value="needs-to-register"/>
@@ -1228,7 +1228,7 @@  discard block
 block discarded – undo
1228 1228
 		 *
1229 1229
 		 * @since 1.7
1230 1230
 		 */
1231
-		do_action( 'give_donation_form_user_info', $form_id );
1231
+		do_action('give_donation_form_user_info', $form_id);
1232 1232
 		?>
1233 1233
 
1234 1234
     </fieldset>
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 	echo ob_get_clean();
1237 1237
 }
1238 1238
 
1239
-add_action( 'give_donation_form_register_fields', 'give_get_register_fields' );
1239
+add_action('give_donation_form_register_fields', 'give_get_register_fields');
1240 1240
 
1241 1241
 /**
1242 1242
  * Gets the login fields for the login form on the checkout. This function hooks
@@ -1249,27 +1249,27 @@  discard block
 block discarded – undo
1249 1249
  *
1250 1250
  * @return string
1251 1251
  */
1252
-function give_get_login_fields( $form_id ) {
1252
+function give_get_login_fields($form_id) {
1253 1253
 
1254
-	$form_id            = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id;
1255
-	$show_register_form = give_show_login_register_option( $form_id );
1254
+	$form_id            = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id;
1255
+	$show_register_form = give_show_login_register_option($form_id);
1256 1256
 
1257 1257
 	ob_start();
1258 1258
 	?>
1259 1259
     <fieldset id="give-login-fields-<?php echo $form_id; ?>">
1260
-        <legend><?php echo apply_filters( 'give_account_login_fieldset_heading', esc_html__( 'Login to Your Account', 'give' ) );
1261
-			if ( ! give_logged_in_only( $form_id ) ) {
1262
-				echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>';
1260
+        <legend><?php echo apply_filters('give_account_login_fieldset_heading', esc_html__('Login to Your Account', 'give'));
1261
+			if ( ! give_logged_in_only($form_id)) {
1262
+				echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>';
1263 1263
 			} ?>
1264 1264
         </legend>
1265
-		<?php if ( $show_register_form == 'both' ) { ?>
1265
+		<?php if ($show_register_form == 'both') { ?>
1266 1266
             <p class="give-new-account-link">
1267
-				<?php esc_html_e( 'Need to create an account?', 'give' ); ?>&nbsp;
1268
-                <a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-cancel"
1267
+				<?php esc_html_e('Need to create an account?', 'give'); ?>&nbsp;
1268
+                <a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-cancel"
1269 1269
                    data-action="give_checkout_register">
1270
-					<?php esc_html_e( 'Register', 'give' );
1271
-					if ( ! give_logged_in_only( $form_id ) ) {
1272
-						echo ' ' . esc_html__( 'and donate as a guest &raquo;', 'give' );
1270
+					<?php esc_html_e('Register', 'give');
1271
+					if ( ! give_logged_in_only($form_id)) {
1272
+						echo ' '.esc_html__('and donate as a guest &raquo;', 'give');
1273 1273
 					} ?>
1274 1274
                 </a>
1275 1275
             </p>
@@ -1285,49 +1285,49 @@  discard block
 block discarded – undo
1285 1285
 		 *
1286 1286
 		 * @param int $form_id The form ID.
1287 1287
 		 */
1288
-		do_action( 'give_checkout_login_fields_before', $form_id );
1288
+		do_action('give_checkout_login_fields_before', $form_id);
1289 1289
 		?>
1290 1290
         <div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first form-row-responsive">
1291 1291
             <label class="give-label" for="give-user-login-<?php echo $form_id; ?>">
1292
-				<?php esc_html_e( 'Username', 'give' ); ?>
1293
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
1292
+				<?php esc_html_e('Username', 'give'); ?>
1293
+				<?php if (give_logged_in_only($form_id)) { ?>
1294 1294
                     <span class="give-required-indicator">*</span>
1295 1295
 				<?php } ?>
1296 1296
             </label>
1297 1297
 
1298
-            <input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>" type="text"
1298
+            <input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>" type="text"
1299 1299
                    name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value=""
1300
-                   placeholder="<?php esc_attr_e( 'Your username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1300
+                   placeholder="<?php esc_attr_e('Your username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1301 1301
         </div>
1302 1302
 
1303 1303
         <div id="give-user-pass-wrap-<?php echo $form_id; ?>"
1304 1304
              class="give_login_password form-row form-row-last form-row-responsive">
1305 1305
             <label class="give-label" for="give-user-pass-<?php echo $form_id; ?>">
1306
-				<?php esc_html_e( 'Password', 'give' ); ?>
1307
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
1306
+				<?php esc_html_e('Password', 'give'); ?>
1307
+				<?php if (give_logged_in_only($form_id)) { ?>
1308 1308
                     <span class="give-required-indicator">*</span>
1309 1309
 				<?php } ?>
1310 1310
             </label>
1311
-            <input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>"
1311
+            <input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>"
1312 1312
                    type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>"
1313
-                   placeholder="<?php esc_attr_e( 'Your password', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1313
+                   placeholder="<?php esc_attr_e('Your password', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1314 1314
             <input type="hidden" name="give-purchase-var" value="needs-to-login"/>
1315 1315
         </div>
1316 1316
 
1317 1317
         <div id="give-forgot-password-wrap-<?php echo $form_id; ?>" class="give_login_forgot_password">
1318 1318
 			 <span class="give-forgot-password ">
1319 1319
 				 <a href="<?php echo wp_lostpassword_url() ?>"
1320
-                    target="_blank"><?php esc_html_e( 'Reset Password', 'give' ) ?></a>
1320
+                    target="_blank"><?php esc_html_e('Reset Password', 'give') ?></a>
1321 1321
 			 </span>
1322 1322
         </div>
1323 1323
 
1324 1324
         <div id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix">
1325 1325
             <input type="submit" class="give-submit give-btn button" name="give_login_submit"
1326
-                   value="<?php esc_attr_e( 'Login', 'give' ); ?>"/>
1327
-			<?php if ( $show_register_form !== 'login' ) { ?>
1326
+                   value="<?php esc_attr_e('Login', 'give'); ?>"/>
1327
+			<?php if ($show_register_form !== 'login') { ?>
1328 1328
                 <input type="button" data-action="give_cancel_login"
1329 1329
                        class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel"
1330
-                       value="<?php esc_attr_e( 'Cancel', 'give' ); ?>"/>
1330
+                       value="<?php esc_attr_e('Cancel', 'give'); ?>"/>
1331 1331
 			<?php } ?>
1332 1332
             <span class="give-loading-animation"></span>
1333 1333
         </div>
@@ -1339,14 +1339,14 @@  discard block
 block discarded – undo
1339 1339
 		 *
1340 1340
 		 * @param int $form_id The form ID.
1341 1341
 		 */
1342
-		do_action( 'give_checkout_login_fields_after', $form_id );
1342
+		do_action('give_checkout_login_fields_after', $form_id);
1343 1343
 		?>
1344 1344
     </fieldset><!--end #give-login-fields-->
1345 1345
 	<?php
1346 1346
 	echo ob_get_clean();
1347 1347
 }
1348 1348
 
1349
-add_action( 'give_donation_form_login_fields', 'give_get_login_fields', 10, 1 );
1349
+add_action('give_donation_form_login_fields', 'give_get_login_fields', 10, 1);
1350 1350
 
1351 1351
 /**
1352 1352
  * Payment Mode Select.
@@ -1362,9 +1362,9 @@  discard block
 block discarded – undo
1362 1362
  *
1363 1363
  * @return void
1364 1364
  */
1365
-function give_payment_mode_select( $form_id ) {
1365
+function give_payment_mode_select($form_id) {
1366 1366
 
1367
-	$gateways = give_get_enabled_payment_gateways( $form_id );
1367
+	$gateways = give_get_enabled_payment_gateways($form_id);
1368 1368
 
1369 1369
 	/**
1370 1370
 	 * Fires while selecting payment gateways, before the fields.
@@ -1373,10 +1373,10 @@  discard block
 block discarded – undo
1373 1373
 	 *
1374 1374
 	 * @param int $form_id The form ID.
1375 1375
 	 */
1376
-	do_action( 'give_payment_mode_top', $form_id );
1376
+	do_action('give_payment_mode_top', $form_id);
1377 1377
 	?>
1378 1378
 
1379
-    <fieldset id="give-payment-mode-select" <?php if ( count( $gateways ) <= 1 ) {
1379
+    <fieldset id="give-payment-mode-select" <?php if (count($gateways) <= 1) {
1380 1380
 		echo 'style="display: none;"';
1381 1381
 	} ?>>
1382 1382
 		<?php
@@ -1387,10 +1387,10 @@  discard block
 block discarded – undo
1387 1387
 		 *
1388 1388
 		 * @param int $form_id The form ID.
1389 1389
 		 */
1390
-		do_action( 'give_payment_mode_before_gateways_wrap' );
1390
+		do_action('give_payment_mode_before_gateways_wrap');
1391 1391
 		?>
1392 1392
         <legend
1393
-                class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', esc_html__( 'Select Payment Method', 'give' ) ); ?>
1393
+                class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', esc_html__('Select Payment Method', 'give')); ?>
1394 1394
             <span class="give-loading-text"><span
1395 1395
                         class="give-loading-animation"></span>
1396 1396
             </span>
@@ -1403,26 +1403,26 @@  discard block
 block discarded – undo
1403 1403
 			 *
1404 1404
 			 * @since 1.7
1405 1405
 			 */
1406
-			do_action( 'give_payment_mode_before_gateways' )
1406
+			do_action('give_payment_mode_before_gateways')
1407 1407
 			?>
1408 1408
             <ul id="give-gateway-radio-list">
1409 1409
 				<?php
1410 1410
 				/**
1411 1411
 				 * Loop through the active payment gateways.
1412 1412
 				 */
1413
-				$selected_gateway  = give_get_chosen_gateway( $form_id );
1413
+				$selected_gateway = give_get_chosen_gateway($form_id);
1414 1414
 
1415
-				foreach ( $gateways as $gateway_id => $gateway ) :
1415
+				foreach ($gateways as $gateway_id => $gateway) :
1416 1416
 					//Determine the default gateway.
1417
-					$checked = checked( $gateway_id, $selected_gateway, false );
1417
+					$checked = checked($gateway_id, $selected_gateway, false);
1418 1418
 					$checked_class = $checked ? ' class="give-gateway-option-selected"' : ''; ?>
1419 1419
                     <li<?php echo $checked_class ?>>
1420 1420
                         <input type="radio" name="payment-mode" class="give-gateway"
1421
-                               id="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>"
1422
-                               value="<?php echo esc_attr( $gateway_id ); ?>"<?php echo $checked; ?>>
1423
-                        <label for="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>"
1421
+                               id="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>"
1422
+                               value="<?php echo esc_attr($gateway_id); ?>"<?php echo $checked; ?>>
1423
+                        <label for="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>"
1424 1424
                                class="give-gateway-option"
1425
-                               id="give-gateway-option-<?php echo esc_attr( $gateway_id ); ?>"> <?php echo esc_html( $gateway['checkout_label'] ); ?></label>
1425
+                               id="give-gateway-option-<?php echo esc_attr($gateway_id); ?>"> <?php echo esc_html($gateway['checkout_label']); ?></label>
1426 1426
                     </li>
1427 1427
 					<?php
1428 1428
 				endforeach;
@@ -1434,7 +1434,7 @@  discard block
 block discarded – undo
1434 1434
 			 *
1435 1435
 			 * @since 1.7
1436 1436
 			 */
1437
-			do_action( 'give_payment_mode_after_gateways' );
1437
+			do_action('give_payment_mode_after_gateways');
1438 1438
 			?>
1439 1439
         </div>
1440 1440
 		<?php
@@ -1445,7 +1445,7 @@  discard block
 block discarded – undo
1445 1445
 		 *
1446 1446
 		 * @param int $form_id The form ID.
1447 1447
 		 */
1448
-		do_action( 'give_payment_mode_after_gateways_wrap' );
1448
+		do_action('give_payment_mode_after_gateways_wrap');
1449 1449
 		?>
1450 1450
     </fieldset>
1451 1451
 
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 	 *
1458 1458
 	 * @param int $form_id The form ID.
1459 1459
 	 */
1460
-	do_action( 'give_payment_mode_bottom', $form_id );
1460
+	do_action('give_payment_mode_bottom', $form_id);
1461 1461
 	?>
1462 1462
 
1463 1463
     <div id="give_purchase_form_wrap">
@@ -1468,7 +1468,7 @@  discard block
 block discarded – undo
1468 1468
 		 *
1469 1469
 		 * @since 1.7
1470 1470
 		 */
1471
-		do_action( 'give_donation_form', $form_id );
1471
+		do_action('give_donation_form', $form_id);
1472 1472
 		?>
1473 1473
 
1474 1474
     </div>
@@ -1479,10 +1479,10 @@  discard block
 block discarded – undo
1479 1479
 	 *
1480 1480
 	 * @since 1.7
1481 1481
 	 */
1482
-	do_action( 'give_donation_form_wrap_bottom', $form_id );
1482
+	do_action('give_donation_form_wrap_bottom', $form_id);
1483 1483
 }
1484 1484
 
1485
-add_action( 'give_payment_mode_select', 'give_payment_mode_select' );
1485
+add_action('give_payment_mode_select', 'give_payment_mode_select');
1486 1486
 
1487 1487
 /**
1488 1488
  * Renders the Checkout Agree to Terms, this displays a checkbox for users to
@@ -1495,31 +1495,31 @@  discard block
 block discarded – undo
1495 1495
  *
1496 1496
  * @return bool
1497 1497
  */
1498
-function give_terms_agreement( $form_id ) {
1499
-	$form_option = give_get_meta( $form_id, '_give_terms_option', true );
1498
+function give_terms_agreement($form_id) {
1499
+	$form_option = give_get_meta($form_id, '_give_terms_option', true);
1500 1500
 
1501 1501
 	// Bailout if per form and global term and conditions is not setup.
1502 1502
 	if (
1503
-		give_is_setting_enabled( $form_option, 'global' )
1504
-		&& give_is_setting_enabled( give_get_option( 'terms' ) )
1503
+		give_is_setting_enabled($form_option, 'global')
1504
+		&& give_is_setting_enabled(give_get_option('terms'))
1505 1505
 	) {
1506
-		$label         = give_get_option( 'agree_to_terms_label', esc_html__( 'Agree to Terms?', 'give' ) );
1507
-		$terms         = $terms = give_get_option( 'agreement_text', '' );
1508
-		$edit_term_url = admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=display&section=term-and-conditions' );
1506
+		$label         = give_get_option('agree_to_terms_label', esc_html__('Agree to Terms?', 'give'));
1507
+		$terms         = $terms = give_get_option('agreement_text', '');
1508
+		$edit_term_url = admin_url('edit.php?post_type=give_forms&page=give-settings&tab=display&section=term-and-conditions');
1509 1509
 
1510
-	} elseif ( give_is_setting_enabled( $form_option ) ) {
1511
-		$label         = ( $label = give_get_meta( $form_id, '_give_agree_label', true ) ) ? stripslashes( $label ) : esc_html__( 'Agree to Terms?', 'give' );
1512
-		$terms         = give_get_meta( $form_id, '_give_agree_text', true );
1513
-		$edit_term_url = admin_url( 'post.php?post=' . $form_id . '&action=edit#form_terms_options' );
1510
+	} elseif (give_is_setting_enabled($form_option)) {
1511
+		$label         = ($label = give_get_meta($form_id, '_give_agree_label', true)) ? stripslashes($label) : esc_html__('Agree to Terms?', 'give');
1512
+		$terms         = give_get_meta($form_id, '_give_agree_text', true);
1513
+		$edit_term_url = admin_url('post.php?post='.$form_id.'&action=edit#form_terms_options');
1514 1514
 
1515 1515
 	} else {
1516 1516
 		return false;
1517 1517
 	}
1518 1518
 
1519 1519
 	// Bailout: Check if term and conditions text is empty or not.
1520
-	if ( empty( $terms ) ) {
1521
-		if ( is_user_logged_in() && current_user_can( 'edit_give_forms' ) ) {
1522
-			echo sprintf( __( 'Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give' ), $edit_term_url );
1520
+	if (empty($terms)) {
1521
+		if (is_user_logged_in() && current_user_can('edit_give_forms')) {
1522
+			echo sprintf(__('Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give'), $edit_term_url);
1523 1523
 		}
1524 1524
 
1525 1525
 		return false;
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
 
1528 1528
 	?>
1529 1529
     <fieldset id="give_terms_agreement">
1530
-        <legend><?php echo apply_filters( 'give_terms_agreement_text', esc_html__( 'Terms', 'give' ) ); ?></legend>
1530
+        <legend><?php echo apply_filters('give_terms_agreement_text', esc_html__('Terms', 'give')); ?></legend>
1531 1531
         <div id="give_terms" class="give_terms-<?php echo $form_id; ?>" style="display:none;">
1532 1532
 			<?php
1533 1533
 			/**
@@ -1535,22 +1535,22 @@  discard block
 block discarded – undo
1535 1535
 			 *
1536 1536
 			 * @since 1.0
1537 1537
 			 */
1538
-			do_action( 'give_before_terms' );
1538
+			do_action('give_before_terms');
1539 1539
 
1540
-			echo wpautop( stripslashes( $terms ) );
1540
+			echo wpautop(stripslashes($terms));
1541 1541
 			/**
1542 1542
 			 * Fires while rendering terms of agreement, after the fields.
1543 1543
 			 *
1544 1544
 			 * @since 1.0
1545 1545
 			 */
1546
-			do_action( 'give_after_terms' );
1546
+			do_action('give_after_terms');
1547 1547
 			?>
1548 1548
         </div>
1549 1549
         <div id="give_show_terms">
1550 1550
             <a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button"
1551
-               aria-controls="give_terms"><?php esc_html_e( 'Show Terms', 'give' ); ?></a>
1551
+               aria-controls="give_terms"><?php esc_html_e('Show Terms', 'give'); ?></a>
1552 1552
             <a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button"
1553
-               aria-controls="give_terms" style="display:none;"><?php esc_html_e( 'Hide Terms', 'give' ); ?></a>
1553
+               aria-controls="give_terms" style="display:none;"><?php esc_html_e('Hide Terms', 'give'); ?></a>
1554 1554
         </div>
1555 1555
 
1556 1556
         <input name="give_agree_to_terms" class="required" type="checkbox"
@@ -1561,7 +1561,7 @@  discard block
 block discarded – undo
1561 1561
 	<?php
1562 1562
 }
1563 1563
 
1564
-add_action( 'give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1 );
1564
+add_action('give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1);
1565 1565
 
1566 1566
 /**
1567 1567
  * Checkout Final Total.
@@ -1574,31 +1574,30 @@  discard block
 block discarded – undo
1574 1574
  *
1575 1575
  * @return void
1576 1576
  */
1577
-function give_checkout_final_total( $form_id ) {
1577
+function give_checkout_final_total($form_id) {
1578 1578
 
1579
-	$total = isset( $_POST['give_total'] ) ?
1580
-		apply_filters( 'give_donation_total', give_maybe_sanitize_amount( $_POST['give_total'] ) ) :
1581
-		give_get_default_form_amount( $form_id );
1579
+	$total = isset($_POST['give_total']) ?
1580
+		apply_filters('give_donation_total', give_maybe_sanitize_amount($_POST['give_total'])) : give_get_default_form_amount($form_id);
1582 1581
 
1583 1582
 
1584 1583
 	//Only proceed if give_total available.
1585
-	if ( empty( $total ) ) {
1584
+	if (empty($total)) {
1586 1585
 		return;
1587 1586
 	}
1588 1587
 	?>
1589 1588
     <p id="give-final-total-wrap" class="form-wrap ">
1590 1589
 		<span class="give-donation-total-label">
1591
-			<?php echo apply_filters( 'give_donation_total_label', esc_html__( 'Donation Total:', 'give' ) ); ?>
1590
+			<?php echo apply_filters('give_donation_total_label', esc_html__('Donation Total:', 'give')); ?>
1592 1591
 		</span>
1593 1592
         <span class="give-final-total-amount"
1594
-              data-total="<?php echo give_format_amount( $total, array( 'sanitize' => false ) ); ?>">
1595
-			<?php echo give_currency_filter( give_format_amount( $total, array( 'sanitize' => false ) ) ); ?>
1593
+              data-total="<?php echo give_format_amount($total, array('sanitize' => false)); ?>">
1594
+			<?php echo give_currency_filter(give_format_amount($total, array('sanitize' => false))); ?>
1596 1595
 		</span>
1597 1596
     </p>
1598 1597
 	<?php
1599 1598
 }
1600 1599
 
1601
-add_action( 'give_donation_form_before_submit', 'give_checkout_final_total', 999 );
1600
+add_action('give_donation_form_before_submit', 'give_checkout_final_total', 999);
1602 1601
 
1603 1602
 /**
1604 1603
  * Renders the Checkout Submit section.
@@ -1609,7 +1608,7 @@  discard block
 block discarded – undo
1609 1608
  *
1610 1609
  * @return void
1611 1610
  */
1612
-function give_checkout_submit( $form_id ) {
1611
+function give_checkout_submit($form_id) {
1613 1612
 	?>
1614 1613
     <fieldset id="give_purchase_submit">
1615 1614
 		<?php
@@ -1618,24 +1617,24 @@  discard block
 block discarded – undo
1618 1617
 		 *
1619 1618
 		 * @since 1.7
1620 1619
 		 */
1621
-		do_action( 'give_donation_form_before_submit', $form_id );
1620
+		do_action('give_donation_form_before_submit', $form_id);
1622 1621
 
1623
-		give_checkout_hidden_fields( $form_id );
1622
+		give_checkout_hidden_fields($form_id);
1624 1623
 
1625
-		echo give_get_donation_form_submit_button( $form_id );
1624
+		echo give_get_donation_form_submit_button($form_id);
1626 1625
 
1627 1626
 		/**
1628 1627
 		 * Fire after donation form submit.
1629 1628
 		 *
1630 1629
 		 * @since 1.7
1631 1630
 		 */
1632
-		do_action( 'give_donation_form_after_submit', $form_id );
1631
+		do_action('give_donation_form_after_submit', $form_id);
1633 1632
 		?>
1634 1633
     </fieldset>
1635 1634
 	<?php
1636 1635
 }
1637 1636
 
1638
-add_action( 'give_donation_form_after_cc_form', 'give_checkout_submit', 9999 );
1637
+add_action('give_donation_form_after_cc_form', 'give_checkout_submit', 9999);
1639 1638
 
1640 1639
 /**
1641 1640
  * Give Donation form submit button.
@@ -1646,10 +1645,10 @@  discard block
 block discarded – undo
1646 1645
  *
1647 1646
  * @return string
1648 1647
  */
1649
-function give_get_donation_form_submit_button( $form_id ) {
1648
+function give_get_donation_form_submit_button($form_id) {
1650 1649
 
1651
-	$display_label_field = give_get_meta( $form_id, '_give_checkout_label', true );
1652
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );
1650
+	$display_label_field = give_get_meta($form_id, '_give_checkout_label', true);
1651
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give'));
1653 1652
 	ob_start();
1654 1653
 	?>
1655 1654
     <div class="give-submit-button-wrap give-clearfix">
@@ -1658,7 +1657,7 @@  discard block
 block discarded – undo
1658 1657
         <span class="give-loading-animation"></span>
1659 1658
     </div>
1660 1659
 	<?php
1661
-	return apply_filters( 'give_donation_form_submit_button', ob_get_clean(), $form_id );
1660
+	return apply_filters('give_donation_form_submit_button', ob_get_clean(), $form_id);
1662 1661
 }
1663 1662
 
1664 1663
 /**
@@ -1673,17 +1672,17 @@  discard block
 block discarded – undo
1673 1672
  *
1674 1673
  * @return mixed
1675 1674
  */
1676
-function give_show_goal_progress( $form_id, $args ) {
1675
+function give_show_goal_progress($form_id, $args) {
1677 1676
 
1678 1677
 	ob_start();
1679
-	give_get_template( 'shortcode-goal', array( 'form_id' => $form_id, 'args' => $args ) );
1678
+	give_get_template('shortcode-goal', array('form_id' => $form_id, 'args' => $args));
1680 1679
 
1681
-	echo apply_filters( 'give_goal_output', ob_get_clean() );
1680
+	echo apply_filters('give_goal_output', ob_get_clean());
1682 1681
 
1683 1682
 	return true;
1684 1683
 }
1685 1684
 
1686
-add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 );
1685
+add_action('give_pre_form', 'give_show_goal_progress', 10, 2);
1687 1686
 
1688 1687
 
1689 1688
 /**
@@ -1696,10 +1695,10 @@  discard block
 block discarded – undo
1696 1695
  *
1697 1696
  * @return mixed|string
1698 1697
  */
1699
-function give_get_form_content_placement( $form_id, $args ) {
1698
+function give_get_form_content_placement($form_id, $args) {
1700 1699
 	$show_content = '';
1701 1700
 
1702
-	if ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) {
1701
+	if (isset($args['show_content']) && ! empty($args['show_content'])) {
1703 1702
 		// Content positions.
1704 1703
 		$content_placement = array(
1705 1704
 			'above' => 'give_pre_form',
@@ -1707,18 +1706,18 @@  discard block
 block discarded – undo
1707 1706
 		);
1708 1707
 
1709 1708
 		// Check if content position already decoded.
1710
-		if ( in_array( $args['show_content'], $content_placement ) ) {
1709
+		if (in_array($args['show_content'], $content_placement)) {
1711 1710
 			return $args['show_content'];
1712 1711
 		}
1713 1712
 
1714
-		$show_content = ( 'none' !== $args['show_content'] ? $content_placement[ $args['show_content'] ] : '' );
1713
+		$show_content = ('none' !== $args['show_content'] ? $content_placement[$args['show_content']] : '');
1715 1714
 
1716
-	} elseif ( give_is_setting_enabled( give_get_meta( $form_id, '_give_display_content', true ) ) ) {
1717
-		$show_content = give_get_meta( $form_id, '_give_content_placement', true );
1715
+	} elseif (give_is_setting_enabled(give_get_meta($form_id, '_give_display_content', true))) {
1716
+		$show_content = give_get_meta($form_id, '_give_content_placement', true);
1718 1717
 
1719
-	} elseif ( 'none' !== give_get_meta( $form_id, '_give_content_option', true ) ) {
1718
+	} elseif ('none' !== give_get_meta($form_id, '_give_content_option', true)) {
1720 1719
 		// Backward compatibility for _give_content_option for v18.
1721
-		$show_content = give_get_meta( $form_id, '_give_content_option', true );
1720
+		$show_content = give_get_meta($form_id, '_give_content_option', true);
1722 1721
 	}
1723 1722
 
1724 1723
 	return $show_content;
@@ -1734,20 +1733,20 @@  discard block
 block discarded – undo
1734 1733
  *
1735 1734
  * @return void|bool
1736 1735
  */
1737
-function give_form_content( $form_id, $args ) {
1736
+function give_form_content($form_id, $args) {
1738 1737
 
1739
-	$show_content = give_get_form_content_placement( $form_id, $args );
1738
+	$show_content = give_get_form_content_placement($form_id, $args);
1740 1739
 
1741 1740
 	// Bailout.
1742
-	if ( empty( $show_content ) ) {
1741
+	if (empty($show_content)) {
1743 1742
 		return false;
1744 1743
 	}
1745 1744
 
1746 1745
 	// Add action according to value.
1747
-	add_action( $show_content, 'give_form_display_content', 10, 2 );
1746
+	add_action($show_content, 'give_form_display_content', 10, 2);
1748 1747
 }
1749 1748
 
1750
-add_action( 'give_pre_form_output', 'give_form_content', 10, 2 );
1749
+add_action('give_pre_form_output', 'give_form_content', 10, 2);
1751 1750
 
1752 1751
 /**
1753 1752
  * Renders Post Form Content.
@@ -1761,22 +1760,22 @@  discard block
 block discarded – undo
1761 1760
  *
1762 1761
  * @return void
1763 1762
  */
1764
-function give_form_display_content( $form_id, $args ) {
1763
+function give_form_display_content($form_id, $args) {
1765 1764
 
1766
-	$content      = wpautop( give_get_meta( $form_id, '_give_form_content', true ) );
1767
-	$show_content = give_get_form_content_placement( $form_id, $args );
1765
+	$content      = wpautop(give_get_meta($form_id, '_give_form_content', true));
1766
+	$show_content = give_get_form_content_placement($form_id, $args);
1768 1767
 
1769
-	if ( give_is_setting_enabled( give_get_option( 'the_content_filter' ) ) ) {
1770
-		$content = apply_filters( 'the_content', $content );
1768
+	if (give_is_setting_enabled(give_get_option('the_content_filter'))) {
1769
+		$content = apply_filters('the_content', $content);
1771 1770
 	}
1772 1771
 
1773
-	$output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap ' . $show_content . '-content">' . $content . '</div>';
1772
+	$output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap '.$show_content.'-content">'.$content.'</div>';
1774 1773
 
1775
-	echo apply_filters( 'give_form_content_output', $output );
1774
+	echo apply_filters('give_form_content_output', $output);
1776 1775
 
1777 1776
 	//remove action to prevent content output on addition forms on page.
1778 1777
 	//@see: https://github.com/WordImpress/Give/issues/634.
1779
-	remove_action( $show_content, 'give_form_display_content' );
1778
+	remove_action($show_content, 'give_form_display_content');
1780 1779
 }
1781 1780
 
1782 1781
 /**
@@ -1788,7 +1787,7 @@  discard block
 block discarded – undo
1788 1787
  *
1789 1788
  * @return void
1790 1789
  */
1791
-function give_checkout_hidden_fields( $form_id ) {
1790
+function give_checkout_hidden_fields($form_id) {
1792 1791
 
1793 1792
 	/**
1794 1793
 	 * Fires while rendering hidden checkout fields, before the fields.
@@ -1797,13 +1796,13 @@  discard block
 block discarded – undo
1797 1796
 	 *
1798 1797
 	 * @param int $form_id The form ID.
1799 1798
 	 */
1800
-	do_action( 'give_hidden_fields_before', $form_id );
1799
+	do_action('give_hidden_fields_before', $form_id);
1801 1800
 
1802
-	if ( is_user_logged_in() ) { ?>
1801
+	if (is_user_logged_in()) { ?>
1803 1802
         <input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/>
1804 1803
 	<?php } ?>
1805 1804
     <input type="hidden" name="give_action" value="purchase"/>
1806
-    <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/>
1805
+    <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/>
1807 1806
 	<?php
1808 1807
 	/**
1809 1808
 	 * Fires while rendering hidden checkout fields, after the fields.
@@ -1812,7 +1811,7 @@  discard block
 block discarded – undo
1812 1811
 	 *
1813 1812
 	 * @param int $form_id The form ID.
1814 1813
 	 */
1815
-	do_action( 'give_hidden_fields_after', $form_id );
1814
+	do_action('give_hidden_fields_after', $form_id);
1816 1815
 
1817 1816
 }
1818 1817
 
@@ -1827,20 +1826,20 @@  discard block
 block discarded – undo
1827 1826
  *
1828 1827
  * @return string $content Filtered content.
1829 1828
  */
1830
-function give_filter_success_page_content( $content ) {
1829
+function give_filter_success_page_content($content) {
1831 1830
 
1832 1831
 	$give_options = give_get_settings();
1833 1832
 
1834
-	if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) {
1835
-		if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) {
1836
-			$content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content );
1833
+	if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) {
1834
+		if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) {
1835
+			$content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content);
1837 1836
 		}
1838 1837
 	}
1839 1838
 
1840 1839
 	return $content;
1841 1840
 }
1842 1841
 
1843
-add_filter( 'the_content', 'give_filter_success_page_content' );
1842
+add_filter('the_content', 'give_filter_success_page_content');
1844 1843
 
1845 1844
 /**
1846 1845
  * Test Mode Frontend Warning.
@@ -1851,12 +1850,12 @@  discard block
 block discarded – undo
1851 1850
  */
1852 1851
 function give_test_mode_frontend_warning() {
1853 1852
 
1854
-	if ( give_is_test_mode() ) {
1855
-		echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>' . esc_html__( 'Notice:', 'give' ) . '</strong> ' . esc_html__( 'Test mode is enabled. While in test mode no live donations are processed.', 'give' ) . '</p></div>';
1853
+	if (give_is_test_mode()) {
1854
+		echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>'.esc_html__('Notice:', 'give').'</strong> '.esc_html__('Test mode is enabled. While in test mode no live donations are processed.', 'give').'</p></div>';
1856 1855
 	}
1857 1856
 }
1858 1857
 
1859
-add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 );
1858
+add_action('give_pre_form', 'give_test_mode_frontend_warning', 10);
1860 1859
 
1861 1860
 /**
1862 1861
  * Members-only Form.
@@ -1870,21 +1869,21 @@  discard block
 block discarded – undo
1870 1869
  *
1871 1870
  * @return string
1872 1871
  */
1873
-function give_members_only_form( $final_output, $args ) {
1872
+function give_members_only_form($final_output, $args) {
1874 1873
 
1875
-	$form_id = isset( $args['form_id'] ) ? $args['form_id'] : 0;
1874
+	$form_id = isset($args['form_id']) ? $args['form_id'] : 0;
1876 1875
 
1877 1876
 	//Sanity Check: Must have form_id & not be logged in.
1878
-	if ( empty( $form_id ) || is_user_logged_in() ) {
1877
+	if (empty($form_id) || is_user_logged_in()) {
1879 1878
 		return $final_output;
1880 1879
 	}
1881 1880
 
1882 1881
 	//Logged in only and Register / Login set to none.
1883
-	if ( give_logged_in_only( $form_id ) && give_show_login_register_option( $form_id ) == 'none' ) {
1882
+	if (give_logged_in_only($form_id) && give_show_login_register_option($form_id) == 'none') {
1884 1883
 
1885
-		$final_output = Give()->notices->print_frontend_notice( esc_html__( 'Please log in in order to complete your donation.', 'give' ), false );
1884
+		$final_output = Give()->notices->print_frontend_notice(esc_html__('Please log in in order to complete your donation.', 'give'), false);
1886 1885
 
1887
-		return apply_filters( 'give_members_only_output', $final_output, $form_id );
1886
+		return apply_filters('give_members_only_output', $final_output, $form_id);
1888 1887
 
1889 1888
 	}
1890 1889
 
@@ -1892,4 +1891,4 @@  discard block
 block discarded – undo
1892 1891
 
1893 1892
 }
1894 1893
 
1895
-add_filter( 'give_donate_form', 'give_members_only_form', 10, 2 );
1894
+add_filter('give_donate_form', 'give_members_only_form', 10, 2);
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1020,9 +1020,12 @@
 block discarded – undo
1020 1020
 				    }
1021 1021
 				    ?>
1022 1022
 			    </select>
1023
-		    <?php else : ?>
1023
+		    <?php else {
1024
+	: ?>
1024 1025
 			    <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input"
1025
-			           placeholder="<?php echo $label; ?>" value="<?php echo $selected_state; ?>"/>
1026
+			           placeholder="<?php echo $label;
1027
+}
1028
+?>" value="<?php echo $selected_state; ?>"/>
1026 1029
 		    <?php endif; ?>
1027 1030
 	    </p>
1028 1031
 
Please login to merge, or discard this patch.