Completed
Push — master ( cec3de...299b30 )
by Devin
12:42
created
includes/forms/template.php 1 patch
Spacing   +382 added lines, -382 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,56 +23,56 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return string $purchase_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
-	$post_id = is_object( $post ) ? $post->ID : 0;
30
+	$post_id = is_object($post) ? $post->ID : 0;
31 31
 
32
-	if ( isset( $args['id'] ) ) {
32
+	if (isset($args['id'])) {
33 33
 		$post_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' => $post_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 = esc_url( add_query_arg( apply_filters( 'give_form_action_args', array(
51
+	$form_action = esc_url(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
-	if ( 'publish' !== $form->post_status && ! current_user_can( 'edit_product', $form->ID ) ) {
57
+	if ('publish' !== $form->post_status && ! current_user_can('edit_product', $form->ID)) {
58 58
 		return false; // Product not published or user doesn't have permission to view drafts
59 59
 	}
60 60
 
61
-	$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )
61
+	$display_option = (isset($args['display_style']) && ! empty($args['display_style']))
62 62
 		? $args['display_style']
63
-		: get_post_meta( $form->ID, '_give_payment_display', true );
63
+		: get_post_meta($form->ID, '_give_payment_display', true);
64 64
 
65
-	$float_labels_option = give_is_float_labels_enabled( $args )
65
+	$float_labels_option = give_is_float_labels_enabled($args)
66 66
 		? ' float-labels-enabled'
67 67
 		: '';
68 68
 
69 69
 
70
-	$form_classes_array = apply_filters( 'give_form_classes', array(
70
+	$form_classes_array = apply_filters('give_form_classes', array(
71 71
 		'give-form-wrap',
72
-		'give-display-' . $display_option
73
-	), $form->ID, $args );
72
+		'give-display-'.$display_option
73
+	), $form->ID, $args);
74 74
 
75
-	$form_classes = implode( ' ', $form_classes_array );
75
+	$form_classes = implode(' ', $form_classes_array);
76 76
 
77 77
 	ob_start();
78 78
 
@@ -84,34 +84,34 @@  discard block
 block discarded – undo
84 84
 	 * @param int $form ->ID The current form ID
85 85
 	 * @param array $args An array of form args
86 86
 	 */
87
-	do_action( 'give_pre_form_output', $form->ID, $args ); ?>
87
+	do_action('give_pre_form_output', $form->ID, $args); ?>
88 88
 
89 89
 	<div id="give-form-<?php echo $form->ID; ?>-wrap" class="<?php echo $form_classes; ?>">
90 90
 
91 91
 		<?php
92
-		if ( isset( $args['show_title'] ) && $args['show_title'] == true ) {
92
+		if (isset($args['show_title']) && $args['show_title'] == true) {
93 93
 
94
-			echo apply_filters( 'give_form_title', '<h2  class="give-form-title">' . get_the_title( $post_id ) . '</h2>' );
94
+			echo apply_filters('give_form_title', '<h2  class="give-form-title">'.get_the_title($post_id).'</h2>');
95 95
 
96 96
 		} ?>
97 97
 
98
-		<?php do_action( 'give_pre_form', $form->ID, $args ); ?>
98
+		<?php do_action('give_pre_form', $form->ID, $args); ?>
99 99
 
100
-		<form id="give-form-<?php echo $post_id; ?>" class="give-form give-form-<?php echo absint( $form->ID ); ?><?php echo $float_labels_option; ?>" action="<?php echo $form_action; ?>" method="post">
100
+		<form id="give-form-<?php echo $post_id; ?>" class="give-form give-form-<?php echo absint($form->ID); ?><?php echo $float_labels_option; ?>" action="<?php echo $form_action; ?>" method="post">
101 101
 			<input type="hidden" name="give-form-id" value="<?php echo $form->ID; ?>"/>
102
-			<input type="hidden" name="give-form-title" value="<?php echo htmlentities( $form->post_title ); ?>"/>
103
-			<input type="hidden" name="give-current-url" value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/>
104
-			<input type="hidden" name="give-form-url" value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/>
105
-			<input type="hidden" name="give-form-minimum" value="<?php echo give_get_form_minimum_price( $form->ID ); ?>"/>
102
+			<input type="hidden" name="give-form-title" value="<?php echo htmlentities($form->post_title); ?>"/>
103
+			<input type="hidden" name="give-current-url" value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/>
104
+			<input type="hidden" name="give-form-url" value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/>
105
+			<input type="hidden" name="give-form-minimum" value="<?php echo give_get_form_minimum_price($form->ID); ?>"/>
106 106
 			<?php
107 107
 			//Price ID hidden field for variable (mult-level) donation forms
108
-			if ( give_has_variable_prices( $post_id ) ) {
108
+			if (give_has_variable_prices($post_id)) {
109 109
 				//get default selected price ID
110
-				$prices   = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $post_id ), $post_id );
110
+				$prices   = apply_filters('give_form_variable_prices', give_get_variable_prices($post_id), $post_id);
111 111
 				$price_id = 0;
112 112
 				//loop through prices
113
-				foreach ( $prices as $price ) {
114
-					if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
113
+				foreach ($prices as $price) {
114
+					if (isset($price['_give_default']) && $price['_give_default'] === 'default') {
115 115
 						$price_id = $price['_give_id']['level_id'];
116 116
 					};
117 117
 				}
@@ -119,19 +119,19 @@  discard block
 block discarded – undo
119 119
 				<input type="hidden" name="give-price-id" value="<?php echo $price_id; ?>"/>
120 120
 			<?php }
121 121
 
122
-			do_action( 'give_checkout_form_top', $form->ID, $args );
122
+			do_action('give_checkout_form_top', $form->ID, $args);
123 123
 
124
-			do_action( 'give_payment_mode_select', $form->ID, $args );
124
+			do_action('give_payment_mode_select', $form->ID, $args);
125 125
 
126
-			do_action( 'give_checkout_form_bottom', $form->ID, $args );
126
+			do_action('give_checkout_form_bottom', $form->ID, $args);
127 127
 
128 128
 			?>
129 129
 
130 130
 		</form>
131 131
 
132
-		<?php do_action( 'give_post_form', $form->ID, $args ); ?>
132
+		<?php do_action('give_post_form', $form->ID, $args); ?>
133 133
 
134
-		<!--end #give-form-<?php echo absint( $form->ID ); ?>--></div>
134
+		<!--end #give-form-<?php echo absint($form->ID); ?>--></div>
135 135
 	<?php
136 136
 
137 137
 	/**
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 	 * @param int $form ->ID The current form ID
143 143
 	 * @param array $args An array of form args
144 144
 	 */
145
-	do_action( 'give_post_form_output', $form->ID, $args );
145
+	do_action('give_post_form_output', $form->ID, $args);
146 146
 
147 147
 	$final_output = ob_get_clean();
148 148
 
149
-	echo apply_filters( 'give_donate_form', $final_output, $args );
149
+	echo apply_filters('give_donate_form', $final_output, $args);
150 150
 }
151 151
 
152 152
 
@@ -166,43 +166,43 @@  discard block
 block discarded – undo
166 166
  * @global    $give_options Array of all the Give options
167 167
  * @return string
168 168
  */
169
-function give_show_purchase_form( $form_id ) {
169
+function give_show_purchase_form($form_id) {
170 170
 
171
-	$payment_mode = give_get_chosen_gateway( $form_id );
171
+	$payment_mode = give_get_chosen_gateway($form_id);
172 172
 
173
-	if ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) {
173
+	if ( ! isset($form_id) && isset($_POST['give_form_id'])) {
174 174
 		$form_id = $_POST['give_form_id'];
175 175
 	}
176 176
 
177
-	do_action( 'give_purchase_form_top', $form_id );
177
+	do_action('give_purchase_form_top', $form_id);
178 178
 
179
-	if ( give_can_checkout() && isset( $form_id ) ) {
179
+	if (give_can_checkout() && isset($form_id)) {
180 180
 
181
-		do_action( 'give_purchase_form_before_register_login', $form_id );
181
+		do_action('give_purchase_form_before_register_login', $form_id);
182 182
 
183
-		do_action( 'give_purchase_form_register_login_fields', $form_id );
183
+		do_action('give_purchase_form_register_login_fields', $form_id);
184 184
 
185
-		do_action( 'give_purchase_form_before_cc_form', $form_id );
185
+		do_action('give_purchase_form_before_cc_form', $form_id);
186 186
 
187 187
 		// Load the credit card form and allow gateways to load their own if they wish
188
-		if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) {
189
-			do_action( 'give_' . $payment_mode . '_cc_form', $form_id );
188
+		if (has_action('give_'.$payment_mode.'_cc_form')) {
189
+			do_action('give_'.$payment_mode.'_cc_form', $form_id);
190 190
 		} else {
191
-			do_action( 'give_cc_form', $form_id );
191
+			do_action('give_cc_form', $form_id);
192 192
 		}
193 193
 
194
-		do_action( 'give_purchase_form_after_cc_form', $form_id );
194
+		do_action('give_purchase_form_after_cc_form', $form_id);
195 195
 
196 196
 	} else {
197 197
 		// Can't checkout
198
-		do_action( 'give_purchase_form_no_access', $form_id );
198
+		do_action('give_purchase_form_no_access', $form_id);
199 199
 
200 200
 	}
201 201
 
202
-	do_action( 'give_purchase_form_bottom', $form_id );
202
+	do_action('give_purchase_form_bottom', $form_id);
203 203
 }
204 204
 
205
-add_action( 'give_purchase_form', 'give_show_purchase_form' );
205
+add_action('give_purchase_form', 'give_show_purchase_form');
206 206
 
207 207
 /**
208 208
  *
@@ -214,26 +214,26 @@  discard block
 block discarded – undo
214 214
  *
215 215
  * @return void
216 216
  */
217
-function give_show_register_login_fields( $form_id ) {
217
+function give_show_register_login_fields($form_id) {
218 218
 
219
-	$show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ), $form_id );
219
+	$show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true), $form_id);
220 220
 
221
-	if ( ( $show_register_form === 'registration' || ( $show_register_form === 'both' && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?>
221
+	if (($show_register_form === 'registration' || ($show_register_form === 'both' && ! isset($_GET['login']))) && ! is_user_logged_in()) : ?>
222 222
 		<div id="give-checkout-login-register-<?php echo $form_id; ?>">
223
-			<?php do_action( 'give_purchase_form_register_fields', $form_id ); ?>
223
+			<?php do_action('give_purchase_form_register_fields', $form_id); ?>
224 224
 		</div>
225
-	<?php elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?>
225
+	<?php elseif (($show_register_form === 'login' || ($show_register_form === 'both' && isset($_GET['login']))) && ! is_user_logged_in()) : ?>
226 226
 		<div id="give-checkout-login-register-<?php echo $form_id; ?>">
227
-			<?php do_action( 'give_purchase_form_login_fields', $form_id ); ?>
227
+			<?php do_action('give_purchase_form_login_fields', $form_id); ?>
228 228
 		</div>
229 229
 	<?php endif; ?>
230 230
 
231
-	<?php if ( ( ! isset( $_GET['login'] ) && is_user_logged_in() ) || ! isset( $show_register_form ) || 'none' === $show_register_form || 'login' === $show_register_form ) {
232
-		do_action( 'give_purchase_form_after_user_info', $form_id );
231
+	<?php if (( ! isset($_GET['login']) && is_user_logged_in()) || ! isset($show_register_form) || 'none' === $show_register_form || 'login' === $show_register_form) {
232
+		do_action('give_purchase_form_after_user_info', $form_id);
233 233
 	}
234 234
 }
235 235
 
236
-add_action( 'give_purchase_form_register_login_fields', 'give_show_register_login_fields' );
236
+add_action('give_purchase_form_register_login_fields', 'give_show_register_login_fields');
237 237
 
238 238
 /**
239 239
  * Donation Amount Field
@@ -247,37 +247,37 @@  discard block
 block discarded – undo
247 247
  *
248 248
  * @return void
249 249
  */
250
-function give_output_donation_amount_top( $form_id = 0, $args = array() ) {
250
+function give_output_donation_amount_top($form_id = 0, $args = array()) {
251 251
 
252 252
 	global $give_options;
253 253
 
254
-	$variable_pricing    = give_has_variable_prices( $form_id );
255
-	$allow_custom_amount = get_post_meta( $form_id, '_give_custom_amount', true );
256
-	$currency_position   = isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before';
257
-	$symbol              = give_currency_symbol( give_get_currency() );
258
-	$currency_output     = '<span class="give-currency-symbol give-currency-position-' . $currency_position . '">' . $symbol . '</span>';
259
-	$default_amount      = give_format_amount( give_get_default_form_amount( $form_id ) );
260
-	$custom_amount_text  = get_post_meta( $form_id, '_give_custom_amount_text', true );
254
+	$variable_pricing    = give_has_variable_prices($form_id);
255
+	$allow_custom_amount = get_post_meta($form_id, '_give_custom_amount', true);
256
+	$currency_position   = isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before';
257
+	$symbol              = give_currency_symbol(give_get_currency());
258
+	$currency_output     = '<span class="give-currency-symbol give-currency-position-'.$currency_position.'">'.$symbol.'</span>';
259
+	$default_amount      = give_format_amount(give_get_default_form_amount($form_id));
260
+	$custom_amount_text  = get_post_meta($form_id, '_give_custom_amount_text', true);
261 261
 
262
-	do_action( 'give_before_donation_levels', $form_id );
262
+	do_action('give_before_donation_levels', $form_id);
263 263
 
264 264
 	//Set Price, No Custom Amount Allowed means hidden price field
265
-	if ( $allow_custom_amount == 'no' ) {
265
+	if ($allow_custom_amount == 'no') {
266 266
 		?>
267 267
 
268
-		<label class="give-hidden" for="give-amount-hidden"><?php echo __( 'Donation Amount:', 'give' ); ?></label>
268
+		<label class="give-hidden" for="give-amount-hidden"><?php echo __('Donation Amount:', 'give'); ?></label>
269 269
 		<input id="give-amount" class="give-amount-hidden" type="hidden" name="give-amount"
270 270
 		       value="<?php echo $default_amount; ?>" required>
271 271
 		<p class="set-price give-donation-amount form-row-wide">
272
-			<?php if ( $currency_position == 'before' ) {
272
+			<?php if ($currency_position == 'before') {
273 273
 				echo $currency_output;
274 274
 			} ?>
275 275
 			<span id="give-amount-text" class="give-text-input give-amount-top"><?php echo $default_amount; ?></span>
276
-			<?php if ( $currency_position == 'after' ) {
276
+			<?php if ($currency_position == 'after') {
277 277
 				echo $currency_output;
278 278
 			} ?>
279 279
 			<span class="give-loading-text give-updating-price-loader">
280
-				<span class="give-loading-animation"></span> <?php _e( 'Updating Amount...', 'give' ); ?>
280
+				<span class="give-loading-animation"></span> <?php _e('Updating Amount...', 'give'); ?>
281 281
 			</span>
282 282
 		</p>
283 283
 		<?php
@@ -286,37 +286,37 @@  discard block
 block discarded – undo
286 286
 		?>
287 287
 		<div class="give-total-wrap">
288 288
 			<div class="give-donation-amount form-row-wide">
289
-				<?php if ( $currency_position == 'before' ) {
289
+				<?php if ($currency_position == 'before') {
290 290
 					echo $currency_output;
291 291
 				} ?>
292
-				<label class="give-hidden" for="give-amount"><?php echo __( 'Donation Amount:', 'give' ); ?></label>
292
+				<label class="give-hidden" for="give-amount"><?php echo __('Donation Amount:', 'give'); ?></label>
293 293
 				<input class="give-text-input give-amount-top" id="give-amount" name="give-amount" type="tel" placeholder="" value="<?php echo $default_amount; ?>" autocomplete="off">
294
-				<?php if ( $currency_position == 'after' ) {
294
+				<?php if ($currency_position == 'after') {
295 295
 					echo $currency_output;
296 296
 				} ?>
297 297
 				<span class="give-loading-text give-updating-price-loader">
298
-					<span class="give-loading-animation"></span> <?php _e( 'Updating Amount...', 'give' ); ?>
298
+					<span class="give-loading-animation"></span> <?php _e('Updating Amount...', 'give'); ?>
299 299
 				</span>
300 300
 			</div>
301 301
 		</div>
302 302
 	<?php }
303 303
 
304
-	do_action( 'give_after_donation_amount', $form_id, $args );
304
+	do_action('give_after_donation_amount', $form_id, $args);
305 305
 	
306 306
 	//Custom Amount Text
307
-	if ( ! $variable_pricing && $allow_custom_amount == 'yes' && ! empty( $custom_amount_text ) ) { ?>
307
+	if ( ! $variable_pricing && $allow_custom_amount == 'yes' && ! empty($custom_amount_text)) { ?>
308 308
 		<p class="give-custom-amount-text"><?php echo $custom_amount_text; ?></p>
309 309
 	<?php }
310 310
 
311 311
 	//Output Variable Pricing Levels
312
-	if ( $variable_pricing ) {
313
-		give_output_levels( $form_id );
312
+	if ($variable_pricing) {
313
+		give_output_levels($form_id);
314 314
 	}
315 315
 
316
-	do_action( 'give_after_donation_levels', $form_id, $args );
316
+	do_action('give_after_donation_levels', $form_id, $args);
317 317
 }
318 318
 
319
-add_action( 'give_checkout_form_top', 'give_output_donation_amount_top', 10, 2 );
319
+add_action('give_checkout_form_top', 'give_output_donation_amount_top', 10, 2);
320 320
 
321 321
 
322 322
 /**
@@ -328,32 +328,32 @@  discard block
 block discarded – undo
328 328
  *
329 329
  * @return string
330 330
  */
331
-function give_output_levels( $form_id ) {
331
+function give_output_levels($form_id) {
332 332
 
333 333
 	//Get variable pricing
334
-	$prices             = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
335
-	$display_style      = get_post_meta( $form_id, '_give_display_style', true );
336
-	$custom_amount      = get_post_meta( $form_id, '_give_custom_amount', true );
337
-	$custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true );
338
-	if ( empty( $custom_amount_text ) ) {
339
-		$custom_amount_text = __( 'Give a Custom Amount', 'give' );
334
+	$prices             = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id);
335
+	$display_style      = get_post_meta($form_id, '_give_display_style', true);
336
+	$custom_amount      = get_post_meta($form_id, '_give_custom_amount', true);
337
+	$custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true);
338
+	if (empty($custom_amount_text)) {
339
+		$custom_amount_text = __('Give a Custom Amount', 'give');
340 340
 	}
341 341
 
342 342
 	$output  = '';
343 343
 	$counter = 0;
344 344
 
345
-	switch ( $display_style ) {
345
+	switch ($display_style) {
346 346
 		case 'buttons':
347 347
 
348 348
 			$output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">';
349 349
 
350
-			foreach ( $prices as $price ) {
351
-				$counter ++;
352
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
353
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-' . $counter . ' ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'give-default-level' : '' ), $form_id, $price );
350
+			foreach ($prices as $price) {
351
+				$counter++;
352
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price);
353
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-'.$counter.' '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'give-default-level' : ''), $form_id, $price);
354 354
 
355 355
 				$output .= '<li>';
356
-				$output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'] ) . '">';
356
+				$output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount']).'">';
357 357
 				$output .= $level_text;
358 358
 				$output .= '</button>';
359 359
 				$output .= '</li>';
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 			}
362 362
 
363 363
 			//Custom Amount
364
-			if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) {
364
+			if ($custom_amount === 'yes' && ! empty($custom_amount_text)) {
365 365
 				$output .= '<li>';
366 366
 				$output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">';
367 367
 				$output .= $custom_amount_text;
@@ -377,23 +377,23 @@  discard block
 block discarded – undo
377 377
 
378 378
 			$output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">';
379 379
 
380
-			foreach ( $prices as $price ) {
381
-				$counter ++;
382
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
383
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-' . $counter . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
380
+			foreach ($prices as $price) {
381
+				$counter++;
382
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price);
383
+				$level_classes = apply_filters('give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-'.$counter.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price);
384 384
 
385 385
 				$output .= '<li>';
386
-				$output .= '<input type="radio" data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" name="give-radio-donation-level" id="give-radio-level-' . $counter . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'checked="checked"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'] ) . '">';
387
-				$output .= '<label for="give-radio-level-' . $counter . '">' . $level_text . '</label>';
386
+				$output .= '<input type="radio" data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" name="give-radio-donation-level" id="give-radio-level-'.$counter.'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'checked="checked"' : '').' value="'.give_format_amount($price['_give_amount']).'">';
387
+				$output .= '<label for="give-radio-level-'.$counter.'">'.$level_text.'</label>';
388 388
 				$output .= '</li>';
389 389
 
390 390
 			}
391 391
 
392 392
 			//Custom Amount
393
-			if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) {
393
+			if ($custom_amount === 'yes' && ! empty($custom_amount_text)) {
394 394
 				$output .= '<li>';
395 395
 				$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">';
396
-				$output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>';
396
+				$output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>';
397 397
 				$output .= '</li>';
398 398
 			}
399 399
 
@@ -403,23 +403,23 @@  discard block
 block discarded – undo
403 403
 
404 404
 		case 'dropdown':
405 405
 
406
-			$output .= '<label for="give-donation-level" class="give-hidden">' . __( 'Choose Your Donation Amount', 'give' ) . ':</label>';
407
-			$output .= '<select id="give-donation-level-' . $form_id . '" class="give-select give-select-level">';
406
+			$output .= '<label for="give-donation-level" class="give-hidden">'.__('Choose Your Donation Amount', 'give').':</label>';
407
+			$output .= '<select id="give-donation-level-'.$form_id.'" class="give-select give-select-level">';
408 408
 
409 409
 			//first loop through prices
410
-			foreach ( $prices as $price ) {
411
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
412
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $form_id, $form_id, $price );
410
+			foreach ($prices as $price) {
411
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price);
412
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$form_id, $form_id, $price);
413 413
 
414
-				$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'] ) . '">';
414
+				$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']).'">';
415 415
 				$output .= $level_text;
416 416
 				$output .= '</option>';
417 417
 
418 418
 			}
419 419
 
420 420
 			//Custom Amount
421
-			if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) {
422
-				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>';
421
+			if ($custom_amount === 'yes' && ! empty($custom_amount_text)) {
422
+				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>';
423 423
 			}
424 424
 
425 425
 			$output .= '</select>';
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 			break;
428 428
 	}
429 429
 
430
-	echo apply_filters( 'give_form_level_output', $output, $form_id );
430
+	echo apply_filters('give_form_level_output', $output, $form_id);
431 431
 }
432 432
 
433 433
 /**
@@ -439,26 +439,26 @@  discard block
 block discarded – undo
439 439
  * @param array $args
440 440
  *
441 441
  */
442
-function give_display_checkout_button( $form_id, $args ) {
442
+function give_display_checkout_button($form_id, $args) {
443 443
 
444
-	$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )
444
+	$display_option = (isset($args['display_style']) && ! empty($args['display_style']))
445 445
 		? $args['display_style']
446
-		: get_post_meta( $form_id, '_give_payment_display', true );
446
+		: get_post_meta($form_id, '_give_payment_display', true);
447 447
 
448 448
 	//no btn for onpage
449
-	if ( $display_option === 'onpage' ) {
449
+	if ($display_option === 'onpage') {
450 450
 		return;
451 451
 	}
452 452
 
453
-	$display_label_field = get_post_meta( $form_id, '_give_reveal_label', true );
454
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : __( 'Donate Now', 'give' ) );
453
+	$display_label_field = get_post_meta($form_id, '_give_reveal_label', true);
454
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : __('Donate Now', 'give'));
455 455
 
456
-	$output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>';
456
+	$output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>';
457 457
 
458
-	echo apply_filters( 'give_display_checkout_button', $output );
458
+	echo apply_filters('give_display_checkout_button', $output);
459 459
 }
460 460
 
461
-add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 );
461
+add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2);
462 462
 
463 463
 /**
464 464
  * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided.
@@ -469,71 +469,71 @@  discard block
 block discarded – undo
469 469
  *
470 470
  * @return void
471 471
  */
472
-function give_user_info_fields( $form_id ) {
472
+function give_user_info_fields($form_id) {
473 473
 
474
-	if ( is_user_logged_in() ) :
475
-		$user_data = get_userdata( get_current_user_id() );
474
+	if (is_user_logged_in()) :
475
+		$user_data = get_userdata(get_current_user_id());
476 476
 	endif;
477 477
 
478
-	do_action( 'give_purchase_form_before_personal_info', $form_id );
478
+	do_action('give_purchase_form_before_personal_info', $form_id);
479 479
 	?>
480 480
 	<fieldset id="give_checkout_user_info">
481
-		<legend><?php echo apply_filters( 'give_checkout_personal_info_text', __( 'Personal Info', 'give' ) ); ?></legend>
481
+		<legend><?php echo apply_filters('give_checkout_personal_info_text', __('Personal Info', 'give')); ?></legend>
482 482
 		<p id="give-first-name-wrap" class="form-row form-row-first">
483 483
 			<label class="give-label" for="give-first">
484
-				<?php _e( 'First Name', 'give' ); ?>
485
-				<?php if ( give_field_is_required( 'give_first', $form_id ) ) { ?>
484
+				<?php _e('First Name', 'give'); ?>
485
+				<?php if (give_field_is_required('give_first', $form_id)) { ?>
486 486
 					<span class="give-required-indicator">*</span>
487 487
 				<?php } ?>
488
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span>
488
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('We will use this to personalize your account experience.', 'give'); ?>"></span>
489 489
 			</label>
490
-			<input class="give-input required" type="text" name="give_first" placeholder="<?php _e( 'First name', 'give' ); ?>" id="give-first" value="<?php echo is_user_logged_in() ? $user_data->first_name : ''; ?>"<?php if ( give_field_is_required( 'give_first', $form_id ) ) {
490
+			<input class="give-input required" type="text" name="give_first" placeholder="<?php _e('First name', 'give'); ?>" id="give-first" value="<?php echo is_user_logged_in() ? $user_data->first_name : ''; ?>"<?php if (give_field_is_required('give_first', $form_id)) {
491 491
 				echo ' required ';
492 492
 			} ?>/>
493 493
 		</p>
494 494
 
495 495
 		<p id="give-last-name-wrap" class="form-row form-row-last">
496 496
 			<label class="give-label" for="give-last">
497
-				<?php _e( 'Last Name', 'give' ); ?>
498
-				<?php if ( give_field_is_required( 'give_last', $form_id ) ) { ?>
497
+				<?php _e('Last Name', 'give'); ?>
498
+				<?php if (give_field_is_required('give_last', $form_id)) { ?>
499 499
 					<span class="give-required-indicator">*</span>
500 500
 				<?php } ?>
501
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will use this as well to personalize your account experience.', 'give' ); ?>"></span>
501
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('We will use this as well to personalize your account experience.', 'give'); ?>"></span>
502 502
 			</label>
503 503
 
504
-			<input class="give-input<?php if ( give_field_is_required( 'give_last', $form_id ) ) {
504
+			<input class="give-input<?php if (give_field_is_required('give_last', $form_id)) {
505 505
 				echo ' required';
506
-			} ?>" type="text" name="give_last" id="give-last" placeholder="<?php _e( 'Last name', 'give' ); ?>" value="<?php echo is_user_logged_in() ? $user_data->last_name : ''; ?>"<?php if ( give_field_is_required( 'give_last', $form_id ) ) {
506
+			} ?>" type="text" name="give_last" id="give-last" placeholder="<?php _e('Last name', 'give'); ?>" value="<?php echo is_user_logged_in() ? $user_data->last_name : ''; ?>"<?php if (give_field_is_required('give_last', $form_id)) {
507 507
 				echo ' required ';
508 508
 			} ?> />
509 509
 		</p>
510 510
 
511
-		<?php do_action( 'give_purchase_form_before_email', $form_id ); ?>
511
+		<?php do_action('give_purchase_form_before_email', $form_id); ?>
512 512
 		<p id="give-email-wrap" class="form-row form-row-wide">
513 513
 			<label class="give-label" for="give-email">
514
-				<?php _e( 'Email Address', 'give' ); ?>
515
-				<?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?>
514
+				<?php _e('Email Address', 'give'); ?>
515
+				<?php if (give_field_is_required('give_email', $form_id)) { ?>
516 516
 					<span class="give-required-indicator">*</span>
517 517
 				<?php } ?>
518
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will send the purchase receipt to this address.', 'give' ); ?>"></span>
518
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('We will send the purchase receipt to this address.', 'give'); ?>"></span>
519 519
 			</label>
520 520
 
521
-			<input class="give-input required" type="email" name="give_email" placeholder="<?php _e( 'Email address', 'give' ); ?>" id="give-email" value="<?php echo is_user_logged_in() ? $user_data->user_email : ''; ?>"<?php if ( give_field_is_required( 'give_email', $form_id ) ) {
521
+			<input class="give-input required" type="email" name="give_email" placeholder="<?php _e('Email address', 'give'); ?>" id="give-email" value="<?php echo is_user_logged_in() ? $user_data->user_email : ''; ?>"<?php if (give_field_is_required('give_email', $form_id)) {
522 522
 				echo ' required ';
523 523
 			} ?>/>
524 524
 
525 525
 		</p>
526
-		<?php do_action( 'give_purchase_form_after_email', $form_id ); ?>
526
+		<?php do_action('give_purchase_form_after_email', $form_id); ?>
527 527
 
528
-		<?php do_action( 'give_purchase_form_user_info', $form_id ); ?>
528
+		<?php do_action('give_purchase_form_user_info', $form_id); ?>
529 529
 	</fieldset>
530 530
 	<?php
531
-	do_action( 'give_purchase_form_after_personal_info', $form_id );
531
+	do_action('give_purchase_form_after_personal_info', $form_id);
532 532
 
533 533
 }
534 534
 
535
-add_action( 'give_purchase_form_after_user_info', 'give_user_info_fields' );
536
-add_action( 'give_register_fields_before', 'give_user_info_fields' );
535
+add_action('give_purchase_form_after_user_info', 'give_user_info_fields');
536
+add_action('give_register_fields_before', 'give_user_info_fields');
537 537
 
538 538
 /**
539 539
  * Renders the credit card info form.
@@ -544,73 +544,73 @@  discard block
 block discarded – undo
544 544
  *
545 545
  * @return void
546 546
  */
547
-function give_get_cc_form( $form_id ) {
547
+function give_get_cc_form($form_id) {
548 548
 
549 549
 	ob_start();
550 550
 
551
-	do_action( 'give_before_cc_fields', $form_id ); ?>
551
+	do_action('give_before_cc_fields', $form_id); ?>
552 552
 
553 553
 	<fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate">
554
-		<legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', __( 'Credit Card Info', 'give' ) ); ?></legend>
555
-		<?php if ( is_ssl() ) : ?>
554
+		<legend><?php echo apply_filters('give_credit_card_fieldset_heading', __('Credit Card Info', 'give')); ?></legend>
555
+		<?php if (is_ssl()) : ?>
556 556
 			<div id="give_secure_site_wrapper-<?php echo $form_id ?>">
557 557
 				<span class="give-icon padlock"></span>
558
-				<span><?php _e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>
558
+				<span><?php _e('This is a secure SSL encrypted payment.', 'give'); ?></span>
559 559
 			</div>
560 560
 		<?php endif; ?>
561 561
 		<p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds">
562 562
 			<label for="card_number-<?php echo $form_id ?>" class="give-label">
563
-				<?php _e( 'Card Number', 'give' ); ?>
563
+				<?php _e('Card Number', 'give'); ?>
564 564
 				<span class="give-required-indicator">*</span>
565
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span>
565
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The (typically) 16 digits on the front of your credit card.', 'give'); ?>"></span>
566 566
 				<span class="card-type"></span>
567 567
 			</label>
568 568
 
569
-			<input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>" class="card-number give-input required" placeholder="<?php _e( 'Card number', 'give' ); ?>" required/>
569
+			<input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>" class="card-number give-input required" placeholder="<?php _e('Card number', 'give'); ?>" required/>
570 570
 		</p>
571 571
 
572 572
 		<p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third">
573 573
 			<label for="card_cvc-<?php echo $form_id ?>" class="give-label">
574
-				<?php _e( 'CVC', 'give' ); ?>
574
+				<?php _e('CVC', 'give'); ?>
575 575
 				<span class="give-required-indicator">*</span>
576
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ); ?>"></span>
576
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The 3 digit (back) or 4 digit (front) value on your card.', 'give'); ?>"></span>
577 577
 			</label>
578 578
 
579
-			<input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>" class="card-cvc give-input required" placeholder="<?php _e( 'Security code', 'give' ); ?>" required/>
579
+			<input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>" class="card-cvc give-input required" placeholder="<?php _e('Security code', 'give'); ?>" required/>
580 580
 		</p>
581 581
 
582 582
 		<p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds">
583 583
 			<label for="card_name-<?php echo $form_id ?>" class="give-label">
584
-				<?php _e( 'Name on the Card', 'give' ); ?>
584
+				<?php _e('Name on the Card', 'give'); ?>
585 585
 				<span class="give-required-indicator">*</span>
586
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The name printed on the front of your credit card.', 'give' ); ?>"></span>
586
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The name printed on the front of your credit card.', 'give'); ?>"></span>
587 587
 			</label>
588 588
 
589
-			<input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>" class="card-name give-input required" placeholder="<?php _e( 'Card name', 'give' ); ?>" required/>
589
+			<input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>" class="card-name give-input required" placeholder="<?php _e('Card name', 'give'); ?>" required/>
590 590
 		</p>
591
-		<?php do_action( 'give_before_cc_expiration' ); ?>
591
+		<?php do_action('give_before_cc_expiration'); ?>
592 592
 		<p class="card-expiration form-row form-row-one-third">
593 593
 			<label for="card_expiry-<?php echo $form_id ?>" class="give-label">
594
-				<?php _e( 'Expiration', 'give' ); ?>
594
+				<?php _e('Expiration', 'give'); ?>
595 595
 				<span class="give-required-indicator">*</span>
596
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The date your credit card expires, typically on the front of the card.', 'give' ); ?>"></span>
596
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The date your credit card expires, typically on the front of the card.', 'give'); ?>"></span>
597 597
 			</label>
598 598
 
599 599
 			<input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month" class="card-expiry-month"/>
600 600
 			<input type="hidden" id="card_exp_year-<?php echo $form_id ?>" name="card_exp_year" class="card-expiry-year"/>
601 601
 
602
-			<input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>" class="card-expiry give-input required" placeholder="<?php _e( 'MM / YY', 'give' ); ?>" required/>
602
+			<input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>" class="card-expiry give-input required" placeholder="<?php _e('MM / YY', 'give'); ?>" required/>
603 603
 		</p>
604
-		<?php do_action( 'give_after_cc_expiration', $form_id ); ?>
604
+		<?php do_action('give_after_cc_expiration', $form_id); ?>
605 605
 
606 606
 	</fieldset>
607 607
 	<?php
608
-	do_action( 'give_after_cc_fields', $form_id );
608
+	do_action('give_after_cc_fields', $form_id);
609 609
 
610 610
 	echo ob_get_clean();
611 611
 }
612 612
 
613
-add_action( 'give_cc_form', 'give_get_cc_form' );
613
+add_action('give_cc_form', 'give_get_cc_form');
614 614
 
615 615
 /**
616 616
  * Outputs the default credit card address fields
@@ -621,110 +621,110 @@  discard block
 block discarded – undo
621 621
  *
622 622
  * @return void
623 623
  */
624
-function give_default_cc_address_fields( $form_id ) {
624
+function give_default_cc_address_fields($form_id) {
625 625
 
626 626
 	$logged_in = is_user_logged_in();
627 627
 
628
-	if ( $logged_in ) {
629
-		$user_address = get_user_meta( get_current_user_id(), '_give_user_address', true );
628
+	if ($logged_in) {
629
+		$user_address = get_user_meta(get_current_user_id(), '_give_user_address', true);
630 630
 	}
631
-	$line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : '';
632
-	$line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : '';
633
-	$city  = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : '';
634
-	$zip   = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : '';
631
+	$line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : '';
632
+	$line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : '';
633
+	$city  = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : '';
634
+	$zip   = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : '';
635 635
 	ob_start(); ?>
636 636
 	<fieldset id="give_cc_address" class="cc-address">
637
-		<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', __( 'Billing Details', 'give' ) ); ?></legend>
638
-		<?php do_action( 'give_cc_billing_top' ); ?>
637
+		<legend><?php echo apply_filters('give_billing_details_fieldset_heading', __('Billing Details', 'give')); ?></legend>
638
+		<?php do_action('give_cc_billing_top'); ?>
639 639
 		<p id="give-card-address-wrap" class="form-row form-row-two-thirds">
640 640
 			<label for="card_address" class="give-label">
641
-				<?php _e( 'Address', 'give' ); ?>
641
+				<?php _e('Address', 'give'); ?>
642 642
 				<?php
643
-				if ( give_field_is_required( 'card_address', $form_id ) ) { ?>
643
+				if (give_field_is_required('card_address', $form_id)) { ?>
644 644
 					<span class="give-required-indicator">*</span>
645 645
 				<?php } ?>
646
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The primary billing address for your credit card.', 'give' ); ?>"></span>
646
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The primary billing address for your credit card.', 'give'); ?>"></span>
647 647
 			</label>
648 648
 
649
-			<input type="text" id="card_address" name="card_address" class="card-address give-input<?php if ( give_field_is_required( 'card_address', $form_id ) ) {
649
+			<input type="text" id="card_address" name="card_address" class="card-address give-input<?php if (give_field_is_required('card_address', $form_id)) {
650 650
 				echo ' required';
651
-			} ?>" placeholder="<?php _e( 'Address line 1', 'give' ); ?>" value="<?php echo $line1; ?>"<?php if ( give_field_is_required( 'card_address', $form_id ) ) {
651
+			} ?>" placeholder="<?php _e('Address line 1', 'give'); ?>" value="<?php echo $line1; ?>"<?php if (give_field_is_required('card_address', $form_id)) {
652 652
 				echo '  required ';
653 653
 			} ?>/>
654 654
 		</p>
655 655
 
656 656
 		<p id="give-card-address-2-wrap" class="form-row form-row-one-third">
657 657
 			<label for="card_address_2" class="give-label">
658
-				<?php _e( 'Address Line 2', 'give' ); ?>
659
-				<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { ?>
658
+				<?php _e('Address Line 2', 'give'); ?>
659
+				<?php if (give_field_is_required('card_address_2', $form_id)) { ?>
660 660
 					<span class="give-required-indicator">*</span>
661 661
 				<?php } ?>
662
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( '(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give' ); ?>"></span>
662
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give'); ?>"></span>
663 663
 			</label>
664 664
 
665
-			<input type="text" id="card_address_2" name="card_address_2" class="card-address-2 give-input<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) {
665
+			<input type="text" id="card_address_2" name="card_address_2" class="card-address-2 give-input<?php if (give_field_is_required('card_address_2', $form_id)) {
666 666
 				echo ' required';
667
-			} ?>" placeholder="<?php _e( 'Address line 2', 'give' ); ?>" value="<?php echo $line2; ?>"<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) {
667
+			} ?>" placeholder="<?php _e('Address line 2', 'give'); ?>" value="<?php echo $line2; ?>"<?php if (give_field_is_required('card_address_2', $form_id)) {
668 668
 				echo ' required ';
669 669
 			} ?>/>
670 670
 		</p>
671 671
 
672 672
 		<p id="give-card-city-wrap" class="form-row form-row-two-thirds">
673 673
 			<label for="card_city" class="give-label">
674
-				<?php _e( 'City', 'give' ); ?>
675
-				<?php if ( give_field_is_required( 'card_city', $form_id ) ) { ?>
674
+				<?php _e('City', 'give'); ?>
675
+				<?php if (give_field_is_required('card_city', $form_id)) { ?>
676 676
 					<span class="give-required-indicator">*</span>
677 677
 				<?php } ?>
678
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The city for your billing address.', 'give' ); ?>"></span>
678
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The city for your billing address.', 'give'); ?>"></span>
679 679
 			</label>
680
-			<input type="text" id="card_city" name="card_city" class="card-city give-input<?php if ( give_field_is_required( 'card_city', $form_id ) ) {
680
+			<input type="text" id="card_city" name="card_city" class="card-city give-input<?php if (give_field_is_required('card_city', $form_id)) {
681 681
 				echo ' required';
682
-			} ?>" placeholder="<?php _e( 'City', 'give' ); ?>" value="<?php echo $city; ?>"<?php if ( give_field_is_required( 'card_city', $form_id ) ) {
682
+			} ?>" placeholder="<?php _e('City', 'give'); ?>" value="<?php echo $city; ?>"<?php if (give_field_is_required('card_city', $form_id)) {
683 683
 				echo ' required ';
684 684
 			} ?>/>
685 685
 		</p>
686 686
 
687 687
 		<p id="give-card-zip-wrap" class="form-row form-row-one-third">
688 688
 			<label for="card_zip" class="give-label">
689
-				<?php _e( 'Zip / Postal Code', 'give' ); ?>
690
-				<?php if ( give_field_is_required( 'card_zip', $form_id ) ) { ?>
689
+				<?php _e('Zip / Postal Code', 'give'); ?>
690
+				<?php if (give_field_is_required('card_zip', $form_id)) { ?>
691 691
 					<span class="give-required-indicator">*</span>
692 692
 				<?php } ?>
693
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span>
693
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The zip or postal code for your billing address.', 'give'); ?>"></span>
694 694
 			</label>
695 695
 
696
-			<input type="text" size="4" id="card_zip" name="card_zip" class="card-zip give-input<?php if ( give_field_is_required( 'card_zip', $form_id ) ) {
696
+			<input type="text" size="4" id="card_zip" name="card_zip" class="card-zip give-input<?php if (give_field_is_required('card_zip', $form_id)) {
697 697
 				echo ' required';
698
-			} ?>" placeholder="<?php _e( 'Zip / Postal code', 'give' ); ?>" value="<?php echo $zip; ?>" <?php if ( give_field_is_required( 'card_zip', $form_id ) ) {
698
+			} ?>" placeholder="<?php _e('Zip / Postal code', 'give'); ?>" value="<?php echo $zip; ?>" <?php if (give_field_is_required('card_zip', $form_id)) {
699 699
 				echo ' required ';
700 700
 			} ?>/>
701 701
 		</p>
702 702
 
703 703
 		<p id="give-card-country-wrap" class="form-row form-row-first">
704 704
 			<label for="billing_country" class="give-label">
705
-				<?php _e( 'Country', 'give' ); ?>
706
-				<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { ?>
705
+				<?php _e('Country', 'give'); ?>
706
+				<?php if (give_field_is_required('billing_country', $form_id)) { ?>
707 707
 					<span class="give-required-indicator">*</span>
708 708
 				<?php } ?>
709
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The country for your billing address.', 'give' ); ?>"></span>
709
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The country for your billing address.', 'give'); ?>"></span>
710 710
 			</label>
711 711
 
712
-			<select name="billing_country" id="billing_country" class="billing-country billing_country give-select<?php if ( give_field_is_required( 'billing_country', $form_id ) ) {
712
+			<select name="billing_country" id="billing_country" class="billing-country billing_country give-select<?php if (give_field_is_required('billing_country', $form_id)) {
713 713
 				echo ' required';
714
-			} ?>"<?php if ( give_field_is_required( 'billing_country', $form_id ) ) {
714
+			} ?>"<?php if (give_field_is_required('billing_country', $form_id)) {
715 715
 				echo ' required ';
716 716
 			} ?>>
717 717
 				<?php
718 718
 
719 719
 				$selected_country = give_get_country();
720 720
 
721
-				if ( $logged_in && ! empty( $user_address['country'] ) && '*' !== $user_address['country'] ) {
721
+				if ($logged_in && ! empty($user_address['country']) && '*' !== $user_address['country']) {
722 722
 					$selected_country = $user_address['country'];
723 723
 				}
724 724
 
725 725
 				$countries = give_get_country_list();
726
-				foreach ( $countries as $country_code => $country ) {
727
-					echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
726
+				foreach ($countries as $country_code => $country) {
727
+					echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
728 728
 				}
729 729
 				?>
730 730
 			</select>
@@ -732,44 +732,44 @@  discard block
 block discarded – undo
732 732
 
733 733
 		<p id="give-card-state-wrap" class="form-row form-row-last">
734 734
 			<label for="card_state" class="give-label">
735
-				<?php _e( 'State / Province', 'give' ); ?>
736
-				<?php if ( give_field_is_required( 'card_state', $form_id ) ) { ?>
735
+				<?php _e('State / Province', 'give'); ?>
736
+				<?php if (give_field_is_required('card_state', $form_id)) { ?>
737 737
 					<span class="give-required-indicator">*</span>
738 738
 				<?php } ?>
739
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The state or province for your billing address.', 'give' ); ?>"></span>
739
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The state or province for your billing address.', 'give'); ?>"></span>
740 740
 			</label>
741 741
 
742 742
 			<?php
743 743
 			$selected_state = give_get_state();
744
-			$states         = give_get_states( $selected_country );
744
+			$states         = give_get_states($selected_country);
745 745
 
746
-			if ( $logged_in && ! empty( $user_address['state'] ) ) {
746
+			if ($logged_in && ! empty($user_address['state'])) {
747 747
 				$selected_state = $user_address['state'];
748 748
 			}
749 749
 
750
-			if ( ! empty( $states ) ) : ?>
751
-				<select name="card_state" id="card_state" class="card_state give-select<?php if ( give_field_is_required( 'card_state', $form_id ) ) {
750
+			if ( ! empty($states)) : ?>
751
+				<select name="card_state" id="card_state" class="card_state give-select<?php if (give_field_is_required('card_state', $form_id)) {
752 752
 					echo ' required';
753
-				} ?>"<?php if ( give_field_is_required( 'card_state', $form_id ) ) {
753
+				} ?>"<?php if (give_field_is_required('card_state', $form_id)) {
754 754
 					echo ' required ';
755 755
 				} ?>>
756 756
 					<?php
757
-					foreach ( $states as $state_code => $state ) {
758
-						echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
757
+					foreach ($states as $state_code => $state) {
758
+						echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
759 759
 					}
760 760
 					?>
761 761
 				</select>
762 762
 			<?php else : ?>
763
-				<input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php _e( 'State / Province', 'give' ); ?>"/>
763
+				<input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php _e('State / Province', 'give'); ?>"/>
764 764
 			<?php endif; ?>
765 765
 		</p>
766
-		<?php do_action( 'give_cc_billing_bottom' ); ?>
766
+		<?php do_action('give_cc_billing_bottom'); ?>
767 767
 	</fieldset>
768 768
 	<?php
769 769
 	echo ob_get_clean();
770 770
 }
771 771
 
772
-add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' );
772
+add_action('give_after_cc_fields', 'give_default_cc_address_fields');
773 773
 
774 774
 
775 775
 /**
@@ -781,93 +781,93 @@  discard block
 block discarded – undo
781 781
  *
782 782
  * @return string
783 783
  */
784
-function give_get_register_fields( $form_id ) {
784
+function give_get_register_fields($form_id) {
785 785
 
786 786
 	global $user_ID;
787 787
 
788
-	if ( is_user_logged_in() ) {
789
-		$user_data = get_userdata( $user_ID );
788
+	if (is_user_logged_in()) {
789
+		$user_data = get_userdata($user_ID);
790 790
 	}
791 791
 
792
-	$show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ), $form_id );
792
+	$show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true), $form_id);
793 793
 
794 794
 	ob_start(); ?>
795 795
 	<fieldset id="give-register-fields-<?php echo $form_id; ?>">
796 796
 
797
-		<?php if ( $show_register_form == 'both' ) { ?>
797
+		<?php if ($show_register_form == 'both') { ?>
798 798
 			<div class="give-login-account-wrap">
799
-				<p class="give-login-message"><?php _e( 'Already have an account?', 'give' ); ?>&nbsp;
800
-					<a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-login" data-action="give_checkout_login"><?php _e( 'Login', 'give' ); ?></a>
799
+				<p class="give-login-message"><?php _e('Already have an account?', 'give'); ?>&nbsp;
800
+					<a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-login" data-action="give_checkout_login"><?php _e('Login', 'give'); ?></a>
801 801
 				</p>
802 802
 				<p class="give-loading-text">
803
-					<span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></p>
803
+					<span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></p>
804 804
 			</div>
805 805
 		<?php } ?>
806 806
 
807
-		<?php do_action( 'give_register_fields_before', $form_id ); ?>
807
+		<?php do_action('give_register_fields_before', $form_id); ?>
808 808
 
809 809
 		<fieldset id="give-register-account-fields-<?php echo $form_id; ?>">
810
-			<legend><?php echo apply_filters( 'give_create_account_fieldset_heading', __( 'Create an account', 'give' ) );
811
-				if ( ! give_logged_in_only( $form_id ) ) {
812
-					echo ' <span class="sub-text">' . __( '(optional)', 'give' ) . '</span>';
810
+			<legend><?php echo apply_filters('give_create_account_fieldset_heading', __('Create an account', 'give'));
811
+				if ( ! give_logged_in_only($form_id)) {
812
+					echo ' <span class="sub-text">'.__('(optional)', 'give').'</span>';
813 813
 				} ?></legend>
814
-			<?php do_action( 'give_register_account_fields_before', $form_id ); ?>
814
+			<?php do_action('give_register_account_fields_before', $form_id); ?>
815 815
 			<p id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third form-row-first">
816 816
 				<label for="give-user-login-<?php echo $form_id; ?>">
817
-					<?php _e( 'Username', 'give' ); ?>
818
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
817
+					<?php _e('Username', 'give'); ?>
818
+					<?php if (give_logged_in_only($form_id)) { ?>
819 819
 						<span class="give-required-indicator">*</span>
820 820
 					<?php } ?>
821
-					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The username you will use to log into your account.', 'give' ); ?>"></span>
821
+					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The username you will use to log into your account.', 'give'); ?>"></span>
822 822
 				</label>
823 823
 
824
-				<input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) {
824
+				<input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) {
825 825
 					echo 'required ';
826
-				} ?>give-input" type="text" placeholder="<?php _e( 'Username', 'give' ); ?>" title="<?php _e( 'Username', 'give' ); ?>"/>
826
+				} ?>give-input" type="text" placeholder="<?php _e('Username', 'give'); ?>" title="<?php _e('Username', 'give'); ?>"/>
827 827
 			</p>
828 828
 
829 829
 			<p id="give-user-pass-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third">
830 830
 				<label for="give-user-pass-<?php echo $form_id; ?>">
831
-					<?php _e( 'Password', 'give' ); ?>
832
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
831
+					<?php _e('Password', 'give'); ?>
832
+					<?php if (give_logged_in_only($form_id)) { ?>
833 833
 						<span class="give-required-indicator">*</span>
834 834
 					<?php } ?>
835
-					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The password used to access your account.', 'give' ); ?>"></span>
835
+					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The password used to access your account.', 'give'); ?>"></span>
836 836
 				</label>
837 837
 
838
-				<input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) {
838
+				<input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) {
839 839
 					echo 'required ';
840
-				} ?>give-input" placeholder="<?php _e( 'Password', 'give' ); ?>" type="password"/>
840
+				} ?>give-input" placeholder="<?php _e('Password', 'give'); ?>" type="password"/>
841 841
 			</p>
842 842
 
843 843
 			<p id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>" class="give-register-password form-row form-row-one-third">
844 844
 				<label for="give-user-pass-confirm-<?php echo $form_id; ?>">
845
-					<?php _e( 'Confirm PW', 'give' ); ?>
846
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
845
+					<?php _e('Confirm PW', 'give'); ?>
846
+					<?php if (give_logged_in_only($form_id)) { ?>
847 847
 						<span class="give-required-indicator">*</span>
848 848
 					<?php } ?>
849
-					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'Please retype your password to confirm.', 'give' ); ?>"></span>
849
+					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('Please retype your password to confirm.', 'give'); ?>"></span>
850 850
 				</label>
851 851
 
852
-				<input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) {
852
+				<input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) {
853 853
 					echo 'required ';
854
-				} ?>give-input" placeholder="<?php _e( 'Confirm password', 'give' ); ?>" type="password"/>
854
+				} ?>give-input" placeholder="<?php _e('Confirm password', 'give'); ?>" type="password"/>
855 855
 			</p>
856
-			<?php do_action( 'give_register_account_fields_after', $form_id ); ?>
856
+			<?php do_action('give_register_account_fields_after', $form_id); ?>
857 857
 		</fieldset>
858 858
 
859
-		<?php do_action( 'give_register_fields_after', $form_id ); ?>
859
+		<?php do_action('give_register_fields_after', $form_id); ?>
860 860
 
861 861
 		<input type="hidden" name="give-purchase-var" value="needs-to-register"/>
862 862
 
863
-		<?php do_action( 'give_purchase_form_user_info', $form_id ); ?>
863
+		<?php do_action('give_purchase_form_user_info', $form_id); ?>
864 864
 
865 865
 	</fieldset>
866 866
 	<?php
867 867
 	echo ob_get_clean();
868 868
 }
869 869
 
870
-add_action( 'give_purchase_form_register_fields', 'give_get_register_fields' );
870
+add_action('give_purchase_form_register_fields', 'give_get_register_fields');
871 871
 
872 872
 /**
873 873
  * Gets the login fields for the login form on the checkout. This function hooks
@@ -880,74 +880,74 @@  discard block
 block discarded – undo
880 880
  *
881 881
  * @return string
882 882
  */
883
-function give_get_login_fields( $form_id ) {
883
+function give_get_login_fields($form_id) {
884 884
 
885
-	$form_id            = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id;
886
-	$show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ), $form_id );
885
+	$form_id            = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id;
886
+	$show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true), $form_id);
887 887
 
888 888
 	ob_start();
889 889
 	?>
890 890
 	<fieldset id="give-login-fields-<?php echo $form_id; ?>">
891
-		<legend><?php echo apply_filters( 'give_account_login_fieldset_heading', __( 'Login to Your Account', 'give' ) );
892
-			if ( ! give_logged_in_only( $form_id ) ) {
893
-				echo ' <span class="sub-text">' . __( '(optional)', 'give' ) . '</span>';
891
+		<legend><?php echo apply_filters('give_account_login_fieldset_heading', __('Login to Your Account', 'give'));
892
+			if ( ! give_logged_in_only($form_id)) {
893
+				echo ' <span class="sub-text">'.__('(optional)', 'give').'</span>';
894 894
 			} ?>
895 895
 		</legend>
896
-		<?php if ( $show_register_form == 'both' ) { ?>
896
+		<?php if ($show_register_form == 'both') { ?>
897 897
 			<p class="give-new-account-link">
898
-				<?php _e( 'Need to create an account?', 'give' ); ?>&nbsp;
899
-				<a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-cancel"
898
+				<?php _e('Need to create an account?', 'give'); ?>&nbsp;
899
+				<a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-cancel"
900 900
 				   data-action="give_checkout_register">
901
-					<?php _e( 'Register', 'give' );
902
-					if ( ! give_logged_in_only( $form_id ) ) {
903
-						echo ' ' . __( 'or checkout as a guest.', 'give' );
901
+					<?php _e('Register', 'give');
902
+					if ( ! give_logged_in_only($form_id)) {
903
+						echo ' '.__('or checkout as a guest.', 'give');
904 904
 					} ?>
905 905
 				</a>
906 906
 			</p>
907 907
 			<p class="give-loading-text">
908
-				<span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?> </p>
908
+				<span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?> </p>
909 909
 		<?php } ?>
910
-		<?php do_action( 'give_checkout_login_fields_before', $form_id ); ?>
910
+		<?php do_action('give_checkout_login_fields_before', $form_id); ?>
911 911
 		<p id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first">
912 912
 			<label class="give-label" for="give-user-login-<?php echo $form_id; ?>">
913
-				<?php _e( 'Username', 'give' ); ?>
914
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
913
+				<?php _e('Username', 'give'); ?>
914
+				<?php if (give_logged_in_only($form_id)) { ?>
915 915
 					<span class="give-required-indicator">*</span>
916 916
 				<?php } ?>
917 917
 			</label>
918 918
 
919
-			<input class="<?php if ( give_logged_in_only( $form_id ) ) {
919
+			<input class="<?php if (give_logged_in_only($form_id)) {
920 920
 				echo 'required ';
921
-			} ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" placeholder="<?php _e( 'Your username', 'give' ); ?>"/>
921
+			} ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" placeholder="<?php _e('Your username', 'give'); ?>"/>
922 922
 		</p>
923 923
 
924 924
 		<p id="give-user-pass-wrap-<?php echo $form_id; ?>" class="give_login_password form-row form-row-last">
925 925
 			<label class="give-label" for="give-user-pass-<?php echo $form_id; ?>">
926
-				<?php _e( 'Password', 'give' ); ?>
927
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
926
+				<?php _e('Password', 'give'); ?>
927
+				<?php if (give_logged_in_only($form_id)) { ?>
928 928
 					<span class="give-required-indicator">*</span>
929 929
 				<?php } ?>
930 930
 			</label>
931
-			<input class="<?php if ( give_logged_in_only( $form_id ) ) {
931
+			<input class="<?php if (give_logged_in_only($form_id)) {
932 932
 				echo 'required ';
933
-			} ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" placeholder="<?php _e( 'Your password', 'give' ); ?>"/>
933
+			} ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" placeholder="<?php _e('Your password', 'give'); ?>"/>
934 934
 			<input type="hidden" name="give-purchase-var" value="needs-to-login"/>
935 935
 		</p>
936 936
 
937 937
 		<p id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix">
938
-			<input type="submit" class="give-submit give-btn button" name="give_login_submit" value="<?php _e( 'Login', 'give' ); ?>"/>
939
-			<?php if ( $show_register_form !== 'login' ) { ?>
940
-				<input type="button" data-action="give_cancel_login" class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel" value="<?php _e( 'Cancel', 'give' ); ?>"/>
938
+			<input type="submit" class="give-submit give-btn button" name="give_login_submit" value="<?php _e('Login', 'give'); ?>"/>
939
+			<?php if ($show_register_form !== 'login') { ?>
940
+				<input type="button" data-action="give_cancel_login" class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel" value="<?php _e('Cancel', 'give'); ?>"/>
941 941
 			<?php } ?>
942 942
 			<span class="give-loading-animation"></span>
943 943
 		</p>
944
-		<?php do_action( 'give_checkout_login_fields_after', $form_id ); ?>
944
+		<?php do_action('give_checkout_login_fields_after', $form_id); ?>
945 945
 	</fieldset><!--end #give-login-fields-->
946 946
 	<?php
947 947
 	echo ob_get_clean();
948 948
 }
949 949
 
950
-add_action( 'give_purchase_form_login_fields', 'give_get_login_fields', 10, 1 );
950
+add_action('give_purchase_form_login_fields', 'give_get_login_fields', 10, 1);
951 951
 
952 952
 /**
953 953
  * Payment Mode Select
@@ -963,49 +963,49 @@  discard block
 block discarded – undo
963 963
  *
964 964
  * @return void
965 965
  */
966
-function give_payment_mode_select( $form_id ) {
966
+function give_payment_mode_select($form_id) {
967 967
 
968 968
 	$gateways = give_get_enabled_payment_gateways();
969 969
 
970
-	do_action( 'give_payment_mode_top', $form_id ); ?>
970
+	do_action('give_payment_mode_top', $form_id); ?>
971 971
 
972 972
 	<fieldset id="give-payment-mode-select">
973
-		<?php do_action( 'give_payment_mode_before_gateways_wrap' ); ?>
973
+		<?php do_action('give_payment_mode_before_gateways_wrap'); ?>
974 974
 		<div id="give-payment-mode-wrap">
975
-			<legend class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', __( 'Select Payment Method', 'give' ) ); ?>
976
-				<span class="give-loading-text"><span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></span>
975
+			<legend class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', __('Select Payment Method', 'give')); ?>
976
+				<span class="give-loading-text"><span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></span>
977 977
 			</legend>
978 978
 			<?php
979 979
 
980
-			do_action( 'give_payment_mode_before_gateways' ) ?>
980
+			do_action('give_payment_mode_before_gateways') ?>
981 981
 
982 982
 			<ul id="give-gateway-radio-list">
983
-				<?php foreach ( $gateways as $gateway_id => $gateway ) :
984
-					$checked       = checked( $gateway_id, give_get_default_gateway( $form_id ), false );
983
+				<?php foreach ($gateways as $gateway_id => $gateway) :
984
+					$checked       = checked($gateway_id, give_get_default_gateway($form_id), false);
985 985
 					$checked_class = $checked ? ' give-gateway-option-selected' : '';
986
-					echo '<li><label for="give-gateway-' . esc_attr( $gateway_id ) . '-' . $form_id . '" class="give-gateway-option' . $checked_class . '" id="give-gateway-option-' . esc_attr( $gateway_id ) . '">';
987
-					echo '<input type="radio" name="payment-mode" class="give-gateway" id="give-gateway-' . esc_attr( $gateway_id ) . '-' . $form_id . '" value="' . esc_attr( $gateway_id ) . '"' . $checked . '>' . esc_html( $gateway['checkout_label'] );
986
+					echo '<li><label for="give-gateway-'.esc_attr($gateway_id).'-'.$form_id.'" class="give-gateway-option'.$checked_class.'" id="give-gateway-option-'.esc_attr($gateway_id).'">';
987
+					echo '<input type="radio" name="payment-mode" class="give-gateway" id="give-gateway-'.esc_attr($gateway_id).'-'.$form_id.'" value="'.esc_attr($gateway_id).'"'.$checked.'>'.esc_html($gateway['checkout_label']);
988 988
 					echo '</label></li>';
989 989
 				endforeach; ?>
990 990
 			</ul>
991
-			<?php do_action( 'give_payment_mode_after_gateways' ); ?>
991
+			<?php do_action('give_payment_mode_after_gateways'); ?>
992 992
 		</div>
993
-		<?php do_action( 'give_payment_mode_after_gateways_wrap' ); ?>
993
+		<?php do_action('give_payment_mode_after_gateways_wrap'); ?>
994 994
 	</fieldset>
995 995
 
996
-	<?php do_action( 'give_payment_mode_bottom', $form_id ); ?>
996
+	<?php do_action('give_payment_mode_bottom', $form_id); ?>
997 997
 
998 998
 	<div id="give_purchase_form_wrap">
999 999
 
1000
-		<?php do_action( 'give_purchase_form', $form_id ); ?>
1000
+		<?php do_action('give_purchase_form', $form_id); ?>
1001 1001
 
1002 1002
 	</div><!-- the checkout fields are loaded into this-->
1003 1003
 
1004
-	<?php do_action( 'give_purchase_form_wrap_bottom', $form_id );
1004
+	<?php do_action('give_purchase_form_wrap_bottom', $form_id);
1005 1005
 
1006 1006
 }
1007 1007
 
1008
-add_action( 'give_payment_mode_select', 'give_payment_mode_select' );
1008
+add_action('give_payment_mode_select', 'give_payment_mode_select');
1009 1009
 
1010 1010
 
1011 1011
 /**
@@ -1020,35 +1020,35 @@  discard block
 block discarded – undo
1020 1020
  *
1021 1021
  * @return void
1022 1022
  */
1023
-function give_terms_agreement( $form_id ) {
1023
+function give_terms_agreement($form_id) {
1024 1024
 
1025
-	$form_option = get_post_meta( $form_id, '_give_terms_option', true );
1026
-	$label       = get_post_meta( $form_id, '_give_agree_label', true );
1027
-	$terms       = get_post_meta( $form_id, '_give_agree_text', true );
1025
+	$form_option = get_post_meta($form_id, '_give_terms_option', true);
1026
+	$label       = get_post_meta($form_id, '_give_agree_label', true);
1027
+	$terms       = get_post_meta($form_id, '_give_agree_text', true);
1028 1028
 
1029
-	if ( $form_option === 'yes' && ! empty( $terms ) ) { ?>
1029
+	if ($form_option === 'yes' && ! empty($terms)) { ?>
1030 1030
 		<fieldset id="give_terms_agreement">
1031 1031
 			<div id="give_terms" style="display:none;">
1032 1032
 				<?php
1033
-				do_action( 'give_before_terms' );
1034
-				echo wpautop( stripslashes( $terms ) );
1035
-				do_action( 'give_after_terms' );
1033
+				do_action('give_before_terms');
1034
+				echo wpautop(stripslashes($terms));
1035
+				do_action('give_after_terms');
1036 1036
 				?>
1037 1037
 			</div>
1038 1038
 			<div id="give_show_terms">
1039
-				<a href="#" class="give_terms_links"><?php _e( 'Show Terms', 'give' ); ?></a>
1040
-				<a href="#" class="give_terms_links" style="display:none;"><?php _e( 'Hide Terms', 'give' ); ?></a>
1039
+				<a href="#" class="give_terms_links"><?php _e('Show Terms', 'give'); ?></a>
1040
+				<a href="#" class="give_terms_links" style="display:none;"><?php _e('Hide Terms', 'give'); ?></a>
1041 1041
 			</div>
1042 1042
 
1043 1043
 			<label
1044
-				for="give_agree_to_terms"><?php echo ! empty( $label ) ? stripslashes( $label ) : __( 'Agree to Terms?', 'give' ); ?></label>
1044
+				for="give_agree_to_terms"><?php echo ! empty($label) ? stripslashes($label) : __('Agree to Terms?', 'give'); ?></label>
1045 1045
 			<input name="give_agree_to_terms" class="required" type="checkbox" id="give_agree_to_terms" value="1"/>
1046 1046
 		</fieldset>
1047 1047
 		<?php
1048 1048
 	}
1049 1049
 }
1050 1050
 
1051
-add_action( 'give_purchase_form_before_submit', 'give_terms_agreement', 10, 1 );
1051
+add_action('give_purchase_form_before_submit', 'give_terms_agreement', 10, 1);
1052 1052
 
1053 1053
 /**
1054 1054
  * Checkout Final Total
@@ -1060,27 +1060,27 @@  discard block
 block discarded – undo
1060 1060
  * @since      1.0
1061 1061
  * @return void
1062 1062
  */
1063
-function give_checkout_final_total( $form_id ) {
1063
+function give_checkout_final_total($form_id) {
1064 1064
 
1065
-	if ( isset( $_POST['give_total'] ) ) {
1066
-		$total = apply_filters( 'give_donation_total', $_POST['give_total'] );
1065
+	if (isset($_POST['give_total'])) {
1066
+		$total = apply_filters('give_donation_total', $_POST['give_total']);
1067 1067
 	} else {
1068 1068
 		//default total
1069
-		$total = give_get_default_form_amount( $form_id );
1069
+		$total = give_get_default_form_amount($form_id);
1070 1070
 	}
1071 1071
 	//Only proceed if give_total available
1072
-	if ( empty( $total ) ) {
1072
+	if (empty($total)) {
1073 1073
 		return;
1074 1074
 	}
1075 1075
 	?>
1076 1076
 	<p id="give-final-total-wrap" class="form-wrap ">
1077
-		<span class="give-donation-total-label"><?php echo apply_filters( 'give_donation_total_label', esc_attr__( 'Donation Total:', 'give' ) ); ?></span>
1078
-		<span class="give-final-total-amount" data-total="<?php echo give_format_amount( $total ); ?>"><?php echo give_currency_filter( give_format_amount( $total ) ); ?></span>
1077
+		<span class="give-donation-total-label"><?php echo apply_filters('give_donation_total_label', esc_attr__('Donation Total:', 'give')); ?></span>
1078
+		<span class="give-final-total-amount" data-total="<?php echo give_format_amount($total); ?>"><?php echo give_currency_filter(give_format_amount($total)); ?></span>
1079 1079
 	</p>
1080 1080
 	<?php
1081 1081
 }
1082 1082
 
1083
-add_action( 'give_purchase_form_before_submit', 'give_checkout_final_total', 999 );
1083
+add_action('give_purchase_form_before_submit', 'give_checkout_final_total', 999);
1084 1084
 
1085 1085
 
1086 1086
 /**
@@ -1092,22 +1092,22 @@  discard block
 block discarded – undo
1092 1092
  *
1093 1093
  * @return void
1094 1094
  */
1095
-function give_checkout_submit( $form_id ) {
1095
+function give_checkout_submit($form_id) {
1096 1096
 	?>
1097 1097
 	<fieldset id="give_purchase_submit">
1098
-		<?php do_action( 'give_purchase_form_before_submit', $form_id ); ?>
1098
+		<?php do_action('give_purchase_form_before_submit', $form_id); ?>
1099 1099
 
1100
-		<?php give_checkout_hidden_fields( $form_id ); ?>
1100
+		<?php give_checkout_hidden_fields($form_id); ?>
1101 1101
 
1102
-		<?php echo give_checkout_button_purchase( $form_id ); ?>
1102
+		<?php echo give_checkout_button_purchase($form_id); ?>
1103 1103
 
1104
-		<?php do_action( 'give_purchase_form_after_submit', $form_id ); ?>
1104
+		<?php do_action('give_purchase_form_after_submit', $form_id); ?>
1105 1105
 
1106 1106
 	</fieldset>
1107 1107
 	<?php
1108 1108
 }
1109 1109
 
1110
-add_action( 'give_purchase_form_after_cc_form', 'give_checkout_submit', 9999 );
1110
+add_action('give_purchase_form_after_cc_form', 'give_checkout_submit', 9999);
1111 1111
 
1112 1112
 
1113 1113
 /**
@@ -1120,10 +1120,10 @@  discard block
 block discarded – undo
1120 1120
  *
1121 1121
  * @return string
1122 1122
  */
1123
-function give_checkout_button_purchase( $form_id ) {
1123
+function give_checkout_button_purchase($form_id) {
1124 1124
 
1125
-	$display_label_field = get_post_meta( $form_id, '_give_checkout_label', true );
1126
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : __( 'Donate Now', 'give' ) );
1125
+	$display_label_field = get_post_meta($form_id, '_give_checkout_label', true);
1126
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : __('Donate Now', 'give'));
1127 1127
 
1128 1128
 	ob_start();
1129 1129
 
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
 		<span class="give-loading-animation"></span>
1135 1135
 	</div>
1136 1136
 	<?php
1137
-	return apply_filters( 'give_checkout_button_purchase', ob_get_clean(), $form_id );
1137
+	return apply_filters('give_checkout_button_purchase', ob_get_clean(), $form_id);
1138 1138
 }
1139 1139
 
1140 1140
 /**
@@ -1148,11 +1148,11 @@  discard block
 block discarded – undo
1148 1148
  *
1149 1149
  * @return void
1150 1150
  */
1151
-function give_agree_to_terms_js( $form_id ) {
1151
+function give_agree_to_terms_js($form_id) {
1152 1152
 
1153
-	$form_option = get_post_meta( $form_id, '_give_terms_option', true );
1153
+	$form_option = get_post_meta($form_id, '_give_terms_option', true);
1154 1154
 
1155
-	if ( $form_option === 'yes' ) {
1155
+	if ($form_option === 'yes') {
1156 1156
 		?>
1157 1157
 		<script type="text/javascript">
1158 1158
 			jQuery(document).ready(function ($) {
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
 	}
1169 1169
 }
1170 1170
 
1171
-add_action( 'give_checkout_form_top', 'give_agree_to_terms_js', 10, 2 );
1171
+add_action('give_checkout_form_top', 'give_agree_to_terms_js', 10, 2);
1172 1172
 
1173 1173
 
1174 1174
 /**
@@ -1181,19 +1181,19 @@  discard block
 block discarded – undo
1181 1181
  *
1182 1182
  * @return void
1183 1183
  */
1184
-function give_form_content( $form_id, $args ) {
1184
+function give_form_content($form_id, $args) {
1185 1185
 
1186
-	$show_content = ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) )
1186
+	$show_content = (isset($args['show_content']) && ! empty($args['show_content']))
1187 1187
 		? $args['show_content']
1188
-		: get_post_meta( $form_id, '_give_content_option', true );
1188
+		: get_post_meta($form_id, '_give_content_option', true);
1189 1189
 
1190
-	if ( $show_content !== 'none' ) {
1190
+	if ($show_content !== 'none') {
1191 1191
 		//add action according to value
1192
-		add_action( $show_content, 'give_form_display_content' );
1192
+		add_action($show_content, 'give_form_display_content');
1193 1193
 	}
1194 1194
 }
1195 1195
 
1196
-add_action( 'give_pre_form_output', 'give_form_content', 10, 2 );
1196
+add_action('give_pre_form_output', 'give_form_content', 10, 2);
1197 1197
 
1198 1198
 /**
1199 1199
  * Show Give Goals
@@ -1206,25 +1206,25 @@  discard block
 block discarded – undo
1206 1206
  * @return mixed
1207 1207
  */
1208 1208
 
1209
-function give_show_goal_progress( $form_id, $args ) {
1209
+function give_show_goal_progress($form_id, $args) {
1210 1210
 
1211
-	$goal_option = get_post_meta( $form_id, '_give_goal_option', true );
1212
-	$form        = new Give_Donate_Form( $form_id );
1211
+	$goal_option = get_post_meta($form_id, '_give_goal_option', true);
1212
+	$form        = new Give_Donate_Form($form_id);
1213 1213
 	$goal        = $form->goal;
1214
-	$goal_format = get_post_meta( $form_id, '_give_goal_format', true );
1214
+	$goal_format = get_post_meta($form_id, '_give_goal_format', true);
1215 1215
 	$income      = $form->get_earnings();
1216
-	$color       = get_post_meta( $form_id, '_give_goal_color', true );
1217
-	$show_text   = (bool) isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true;
1218
-	$show_bar    = (bool) isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true;
1216
+	$color       = get_post_meta($form_id, '_give_goal_color', true);
1217
+	$show_text   = (bool) isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true;
1218
+	$show_bar    = (bool) isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true;
1219 1219
 
1220 1220
 	//Sanity check - respect shortcode args
1221
-	if ( isset( $args['show_goal'] ) && $args['show_goal'] === false ) {
1221
+	if (isset($args['show_goal']) && $args['show_goal'] === false) {
1222 1222
 		return false;
1223 1223
 	}
1224 1224
 
1225 1225
 	//Sanity check - ensure form has goal set to output
1226
-	if ( empty( $form->ID )
1227
-	     || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' )
1226
+	if (empty($form->ID)
1227
+	     || (is_singular('give_forms') && $goal_option !== 'yes')
1228 1228
 	     || $goal_option !== 'yes'
1229 1229
 	     || $goal == 0
1230 1230
 	) {
@@ -1232,26 +1232,26 @@  discard block
 block discarded – undo
1232 1232
 		return false;
1233 1233
 	}
1234 1234
 
1235
-	$progress = round( ( $income / $goal ) * 100, 2 );
1235
+	$progress = round(($income / $goal) * 100, 2);
1236 1236
 
1237
-	if ( $income > $goal ) {
1237
+	if ($income > $goal) {
1238 1238
 		$progress = 100;
1239 1239
 	}
1240 1240
 
1241 1241
 	$output = '<div class="give-goal-progress">';
1242 1242
 
1243 1243
 	//Goal Progress Text
1244
-	if ( ! empty( $show_text ) ) {
1244
+	if ( ! empty($show_text)) {
1245 1245
 
1246 1246
 		$output .= '<div class="raised">';
1247 1247
 
1248
-		if ( $goal_format !== 'percentage' ) {
1248
+		if ($goal_format !== 'percentage') {
1249 1249
 
1250
-			$output .= sprintf( _x( '%s of %s raised', 'This text displays the amount of income raised compared to the goal.', 'give' ), '<span class="income">' . apply_filters( 'give_goal_amount_raised_output', give_currency_filter( give_format_amount( $income ) ) ) . '</span>', '<span class="goal-text">' . apply_filters( 'give_goal_amount_target_output', give_currency_filter( give_format_amount( $goal ) ) ) ) . '</span>';
1250
+			$output .= sprintf(_x('%s of %s raised', 'This text displays the amount of income raised compared to the goal.', 'give'), '<span class="income">'.apply_filters('give_goal_amount_raised_output', give_currency_filter(give_format_amount($income))).'</span>', '<span class="goal-text">'.apply_filters('give_goal_amount_target_output', give_currency_filter(give_format_amount($goal)))).'</span>';
1251 1251
 
1252
-		} elseif ( $goal_format == 'percentage' ) {
1252
+		} elseif ($goal_format == 'percentage') {
1253 1253
 
1254
-			$output .= sprintf( _x( '%s%% funded', 'This text displays the percentage amount of income raised compared to the goal target.', 'give' ), '<span class="give-percentage">' . apply_filters( 'give_goal_amount_funded_percentage_output', round( $progress ) ) . '</span>' ) . '</span>';
1254
+			$output .= sprintf(_x('%s%% funded', 'This text displays the percentage amount of income raised compared to the goal target.', 'give'), '<span class="give-percentage">'.apply_filters('give_goal_amount_funded_percentage_output', round($progress)).'</span>').'</span>';
1255 1255
 
1256 1256
 		}
1257 1257
 
@@ -1260,11 +1260,11 @@  discard block
 block discarded – undo
1260 1260
 	}
1261 1261
 
1262 1262
 	//Goal Progress Bar
1263
-	if ( ! empty( $show_bar ) ) {
1263
+	if ( ! empty($show_bar)) {
1264 1264
 		$output .= '<div class="give-progress-bar">';
1265
-		$output .= '<span style="width: ' . esc_attr( $progress ) . '%;';
1266
-		if ( ! empty( $color ) ) {
1267
-			$output .= 'background-color:' . $color;
1265
+		$output .= '<span style="width: '.esc_attr($progress).'%;';
1266
+		if ( ! empty($color)) {
1267
+			$output .= 'background-color:'.$color;
1268 1268
 		}
1269 1269
 		$output .= '"></span>';
1270 1270
 		$output .= '</div><!-- /.give-progress-bar -->';
@@ -1272,13 +1272,13 @@  discard block
 block discarded – undo
1272 1272
 
1273 1273
 	$output .= '</div><!-- /.goal-progress -->';
1274 1274
 
1275
-	echo apply_filters( 'give_goal_output', $output );
1275
+	echo apply_filters('give_goal_output', $output);
1276 1276
 
1277 1277
 	return false;
1278 1278
 
1279 1279
 }
1280 1280
 
1281
-add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 );
1281
+add_action('give_pre_form', 'give_show_goal_progress', 10, 2);
1282 1282
 
1283 1283
 /**
1284 1284
  * Renders Post Form Content
@@ -1290,17 +1290,17 @@  discard block
 block discarded – undo
1290 1290
  * @return void
1291 1291
  * @since      1.0
1292 1292
  */
1293
-function give_form_display_content( $form_id ) {
1293
+function give_form_display_content($form_id) {
1294 1294
 
1295
-	$content = wpautop( get_post_meta( $form_id, '_give_form_content', true ) );
1295
+	$content = wpautop(get_post_meta($form_id, '_give_form_content', true));
1296 1296
 
1297
-	if ( give_get_option( 'disable_the_content_filter' ) !== 'on' ) {
1298
-		$content = apply_filters( 'the_content', $content );
1297
+	if (give_get_option('disable_the_content_filter') !== 'on') {
1298
+		$content = apply_filters('the_content', $content);
1299 1299
 	}
1300 1300
 
1301
-	$output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap" >' . $content . '</div>';
1301
+	$output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap" >'.$content.'</div>';
1302 1302
 
1303
-	echo apply_filters( 'give_form_content_output', $output );
1303
+	echo apply_filters('give_form_content_output', $output);
1304 1304
 }
1305 1305
 
1306 1306
 
@@ -1313,16 +1313,16 @@  discard block
 block discarded – undo
1313 1313
  *
1314 1314
  * @return void
1315 1315
  */
1316
-function give_checkout_hidden_fields( $form_id ) {
1316
+function give_checkout_hidden_fields($form_id) {
1317 1317
 
1318
-	do_action( 'give_hidden_fields_before', $form_id );
1319
-	if ( is_user_logged_in() ) { ?>
1318
+	do_action('give_hidden_fields_before', $form_id);
1319
+	if (is_user_logged_in()) { ?>
1320 1320
 		<input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/>
1321 1321
 	<?php } ?>
1322 1322
 	<input type="hidden" name="give_action" value="purchase"/>
1323
-	<input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/>
1323
+	<input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/>
1324 1324
 	<?php
1325
-	do_action( 'give_hidden_fields_after', $form_id );
1325
+	do_action('give_hidden_fields_after', $form_id);
1326 1326
 
1327 1327
 }
1328 1328
 
@@ -1337,20 +1337,20 @@  discard block
 block discarded – undo
1337 1337
  *
1338 1338
  * @return string $content Filtered content
1339 1339
  */
1340
-function give_filter_success_page_content( $content ) {
1340
+function give_filter_success_page_content($content) {
1341 1341
 
1342 1342
 	global $give_options;
1343 1343
 
1344
-	if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) {
1345
-		if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) {
1346
-			$content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content );
1344
+	if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) {
1345
+		if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) {
1346
+			$content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content);
1347 1347
 		}
1348 1348
 	}
1349 1349
 
1350 1350
 	return $content;
1351 1351
 }
1352 1352
 
1353
-add_filter( 'the_content', 'give_filter_success_page_content' );
1353
+add_filter('the_content', 'give_filter_success_page_content');
1354 1354
 
1355 1355
 
1356 1356
 /**
@@ -1362,11 +1362,11 @@  discard block
 block discarded – undo
1362 1362
 
1363 1363
 function give_test_mode_frontend_warning() {
1364 1364
 
1365
-	$test_mode = give_get_option( 'test_mode' );
1365
+	$test_mode = give_get_option('test_mode');
1366 1366
 
1367
-	if ( $test_mode == 'on' ) {
1368
-		echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>' . __( 'Notice', 'give' ) . '</strong>: ' . esc_attr__( 'Test mode is enabled. While in test mode no live transactions are processed.', 'give' ) . '</p></div>';
1367
+	if ($test_mode == 'on') {
1368
+		echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>'.__('Notice', 'give').'</strong>: '.esc_attr__('Test mode is enabled. While in test mode no live transactions are processed.', 'give').'</p></div>';
1369 1369
 	}
1370 1370
 }
1371 1371
 
1372
-add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 );
1372
+add_action('give_pre_form', 'give_test_mode_frontend_warning', 10);
Please login to merge, or discard this patch.