Completed
Push — master ( 36b4cc...47e416 )
by Devin
10s
created
includes/class-give-stats.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -121,6 +121,7 @@
 block discarded – undo
121 121
 	 *
122 122
 	 * @access public
123 123
 	 * @since  1.0
124
+	 * @param string|boolean $date
124 125
 	 * @return array|WP_Error If the date is invalid, a WP_Error object will be returned
125 126
 	 */
126 127
 	public function convert_date( $date, $end_date = false ) {
Please login to merge, or discard this patch.
Spacing   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -76,19 +76,19 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function get_predefined_dates() {
78 78
 		$predefined = array(
79
-			'today'        => esc_html( 'Today', 'give' ),
80
-			'yesterday'    => esc_html( 'Yesterday', 'give' ),
81
-			'this_week'    => esc_html( 'This Week', 'give' ),
82
-			'last_week'    => esc_html( 'Last Week', 'give' ),
83
-			'this_month'   => esc_html( 'This Month', 'give' ),
84
-			'last_month'   => esc_html( 'Last Month', 'give' ),
85
-			'this_quarter' => esc_html( 'This Quarter', 'give' ),
86
-			'last_quarter' => esc_html( 'Last Quarter', 'give' ),
87
-			'this_year'    => esc_html( 'This Year', 'give' ),
88
-			'last_year'    => esc_html( 'Last Year', 'give' )
79
+			'today'        => esc_html('Today', 'give'),
80
+			'yesterday'    => esc_html('Yesterday', 'give'),
81
+			'this_week'    => esc_html('This Week', 'give'),
82
+			'last_week'    => esc_html('Last Week', 'give'),
83
+			'this_month'   => esc_html('This Month', 'give'),
84
+			'last_month'   => esc_html('Last Month', 'give'),
85
+			'this_quarter' => esc_html('This Quarter', 'give'),
86
+			'last_quarter' => esc_html('Last Quarter', 'give'),
87
+			'this_year'    => esc_html('This Year', 'give'),
88
+			'last_year'    => esc_html('Last Year', 'give')
89 89
 		);
90 90
 
91
-		return apply_filters( 'give_stats_predefined_dates', $predefined );
91
+		return apply_filters('give_stats_predefined_dates', $predefined);
92 92
 	}
93 93
 
94 94
 	/**
@@ -104,18 +104,18 @@  discard block
 block discarded – undo
104 104
 	 *
105 105
 	 * @return void
106 106
 	 */
107
-	public function setup_dates( $_start_date = 'this_month', $_end_date = false ) {
107
+	public function setup_dates($_start_date = 'this_month', $_end_date = false) {
108 108
 
109
-		if ( empty( $_start_date ) ) {
109
+		if (empty($_start_date)) {
110 110
 			$_start_date = 'this_month';
111 111
 		}
112 112
 
113
-		if ( empty( $_end_date ) ) {
113
+		if (empty($_end_date)) {
114 114
 			$_end_date = $_start_date;
115 115
 		}
116 116
 
117
-		$this->start_date = $this->convert_date( $_start_date );
118
-		$this->end_date   = $this->convert_date( $_end_date, true );
117
+		$this->start_date = $this->convert_date($_start_date);
118
+		$this->end_date   = $this->convert_date($_end_date, true);
119 119
 	}
120 120
 
121 121
 	/**
@@ -125,26 +125,26 @@  discard block
 block discarded – undo
125 125
 	 * @since  1.0
126 126
 	 * @return array|WP_Error If the date is invalid, a WP_Error object will be returned
127 127
 	 */
128
-	public function convert_date( $date, $end_date = false ) {
128
+	public function convert_date($date, $end_date = false) {
129 129
 
130 130
 		$this->timestamp = false;
131 131
 		$second          = $end_date ? 59 : 0;
132 132
 		$minute          = $end_date ? 59 : 0;
133 133
 		$hour            = $end_date ? 23 : 0;
134 134
 		$day             = 1;
135
-		$month           = date( 'n', current_time( 'timestamp' ) );
136
-		$year            = date( 'Y', current_time( 'timestamp' ) );
135
+		$month           = date('n', current_time('timestamp'));
136
+		$year            = date('Y', current_time('timestamp'));
137 137
 
138
-		if ( array_key_exists( $date, $this->get_predefined_dates() ) ) {
138
+		if (array_key_exists($date, $this->get_predefined_dates())) {
139 139
 
140 140
 			// This is a predefined date rate, such as last_week
141
-			switch ( $date ) {
141
+			switch ($date) {
142 142
 
143 143
 				case 'this_month' :
144 144
 
145
-					if ( $end_date ) {
145
+					if ($end_date) {
146 146
 
147
-						$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
147
+						$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
148 148
 						$hour   = 23;
149 149
 						$minute = 59;
150 150
 						$second = 59;
@@ -154,28 +154,28 @@  discard block
 block discarded – undo
154 154
 
155 155
 				case 'last_month' :
156 156
 
157
-					if ( $month == 1 ) {
157
+					if ($month == 1) {
158 158
 
159 159
 						$month = 12;
160
-						$year --;
160
+						$year--;
161 161
 
162 162
 					} else {
163 163
 
164
-						$month --;
164
+						$month--;
165 165
 
166 166
 					}
167 167
 
168
-					if ( $end_date ) {
169
-						$day = cal_days_in_month( CAL_GREGORIAN, $month, $year );
168
+					if ($end_date) {
169
+						$day = cal_days_in_month(CAL_GREGORIAN, $month, $year);
170 170
 					}
171 171
 
172 172
 					break;
173 173
 
174 174
 				case 'today' :
175 175
 
176
-					$day = date( 'd', current_time( 'timestamp' ) );
176
+					$day = date('d', current_time('timestamp'));
177 177
 
178
-					if ( $end_date ) {
178
+					if ($end_date) {
179 179
 						$hour   = 23;
180 180
 						$minute = 59;
181 181
 						$second = 59;
@@ -185,23 +185,23 @@  discard block
 block discarded – undo
185 185
 
186 186
 				case 'yesterday' :
187 187
 
188
-					$day = date( 'd', current_time( 'timestamp' ) ) - 1;
188
+					$day = date('d', current_time('timestamp')) - 1;
189 189
 
190 190
 					// Check if Today is the first day of the month (meaning subtracting one will get us 0)
191
-					if ( $day < 1 ) {
191
+					if ($day < 1) {
192 192
 
193 193
 						// If current month is 1
194
-						if ( 1 == $month ) {
194
+						if (1 == $month) {
195 195
 
196 196
 							$year -= 1; // Today is January 1, so skip back to last day of December
197 197
 							$month = 12;
198
-							$day   = cal_days_in_month( CAL_GREGORIAN, $month, $year );
198
+							$day   = cal_days_in_month(CAL_GREGORIAN, $month, $year);
199 199
 
200 200
 						} else {
201 201
 
202 202
 							// Go back one month and get the last day of the month
203 203
 							$month -= 1;
204
-							$day = cal_days_in_month( CAL_GREGORIAN, $month, $year );
204
+							$day = cal_days_in_month(CAL_GREGORIAN, $month, $year);
205 205
 
206 206
 						}
207 207
 					}
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
 
211 211
 				case 'this_week' :
212 212
 
213
-					$days_to_week_start = ( date( 'w', current_time( 'timestamp' ) ) - 1 ) * 60 * 60 * 24;
214
-					$today              = date( 'd', current_time( 'timestamp' ) ) * 60 * 60 * 24;
213
+					$days_to_week_start = (date('w', current_time('timestamp')) - 1) * 60 * 60 * 24;
214
+					$today              = date('d', current_time('timestamp')) * 60 * 60 * 24;
215 215
 
216
-					if ( $today < $days_to_week_start ) {
216
+					if ($today < $days_to_week_start) {
217 217
 
218
-						if ( $month > 1 ) {
218
+						if ($month > 1) {
219 219
 							$month -= 1;
220 220
 						} else {
221 221
 							$month = 12;
@@ -223,19 +223,19 @@  discard block
 block discarded – undo
223 223
 
224 224
 					}
225 225
 
226
-					if ( ! $end_date ) {
226
+					if ( ! $end_date) {
227 227
 
228 228
 						// Getting the start day
229 229
 
230
-						$day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 1;
231
-						$day += get_option( 'start_of_week' );
230
+						$day = date('d', current_time('timestamp') - $days_to_week_start) - 1;
231
+						$day += get_option('start_of_week');
232 232
 
233 233
 					} else {
234 234
 
235 235
 						// Getting the end day
236 236
 
237
-						$day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 1;
238
-						$day += get_option( 'start_of_week' ) + 6;
237
+						$day = date('d', current_time('timestamp') - $days_to_week_start) - 1;
238
+						$day += get_option('start_of_week') + 6;
239 239
 
240 240
 					}
241 241
 
@@ -243,12 +243,12 @@  discard block
 block discarded – undo
243 243
 
244 244
 				case 'last_week' :
245 245
 
246
-					$days_to_week_start = ( date( 'w', current_time( 'timestamp' ) ) - 1 ) * 60 * 60 * 24;
247
-					$today              = date( 'd', current_time( 'timestamp' ) ) * 60 * 60 * 24;
246
+					$days_to_week_start = (date('w', current_time('timestamp')) - 1) * 60 * 60 * 24;
247
+					$today              = date('d', current_time('timestamp')) * 60 * 60 * 24;
248 248
 
249
-					if ( $today < $days_to_week_start ) {
249
+					if ($today < $days_to_week_start) {
250 250
 
251
-						if ( $month > 1 ) {
251
+						if ($month > 1) {
252 252
 							$month -= 1;
253 253
 						} else {
254 254
 							$month = 12;
@@ -256,19 +256,19 @@  discard block
 block discarded – undo
256 256
 
257 257
 					}
258 258
 
259
-					if ( ! $end_date ) {
259
+					if ( ! $end_date) {
260 260
 
261 261
 						// Getting the start day
262 262
 
263
-						$day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 8;
264
-						$day += get_option( 'start_of_week' );
263
+						$day = date('d', current_time('timestamp') - $days_to_week_start) - 8;
264
+						$day += get_option('start_of_week');
265 265
 
266 266
 					} else {
267 267
 
268 268
 						// Getting the end day
269 269
 
270
-						$day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 8;
271
-						$day += get_option( 'start_of_week' ) + 6;
270
+						$day = date('d', current_time('timestamp') - $days_to_week_start) - 8;
271
+						$day += get_option('start_of_week') + 6;
272 272
 
273 273
 					}
274 274
 
@@ -276,39 +276,39 @@  discard block
 block discarded – undo
276 276
 
277 277
 				case 'this_quarter' :
278 278
 
279
-					$month_now = date( 'n', current_time( 'timestamp' ) );
279
+					$month_now = date('n', current_time('timestamp'));
280 280
 
281
-					if ( $month_now <= 3 ) {
281
+					if ($month_now <= 3) {
282 282
 
283
-						if ( ! $end_date ) {
283
+						if ( ! $end_date) {
284 284
 							$month = 1;
285 285
 						} else {
286 286
 							$month  = 3;
287
-							$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
287
+							$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
288 288
 							$hour   = 23;
289 289
 							$minute = 59;
290 290
 							$second = 59;
291 291
 						}
292 292
 
293
-					} else if ( $month_now <= 6 ) {
293
+					} else if ($month_now <= 6) {
294 294
 
295
-						if ( ! $end_date ) {
295
+						if ( ! $end_date) {
296 296
 							$month = 4;
297 297
 						} else {
298 298
 							$month  = 6;
299
-							$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
299
+							$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
300 300
 							$hour   = 23;
301 301
 							$minute = 59;
302 302
 							$second = 59;
303 303
 						}
304 304
 
305
-					} else if ( $month_now <= 9 ) {
305
+					} else if ($month_now <= 9) {
306 306
 
307
-						if ( ! $end_date ) {
307
+						if ( ! $end_date) {
308 308
 							$month = 7;
309 309
 						} else {
310 310
 							$month  = 9;
311
-							$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
311
+							$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
312 312
 							$hour   = 23;
313 313
 							$minute = 59;
314 314
 							$second = 59;
@@ -316,11 +316,11 @@  discard block
 block discarded – undo
316 316
 
317 317
 					} else {
318 318
 
319
-						if ( ! $end_date ) {
319
+						if ( ! $end_date) {
320 320
 							$month = 10;
321 321
 						} else {
322 322
 							$month  = 12;
323
-							$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
323
+							$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
324 324
 							$hour   = 23;
325 325
 							$minute = 59;
326 326
 							$second = 59;
@@ -332,40 +332,40 @@  discard block
 block discarded – undo
332 332
 
333 333
 				case 'last_quarter' :
334 334
 
335
-					$month_now = date( 'n', current_time( 'timestamp' ) );
335
+					$month_now = date('n', current_time('timestamp'));
336 336
 
337
-					if ( $month_now <= 3 ) {
337
+					if ($month_now <= 3) {
338 338
 
339
-						if ( ! $end_date ) {
339
+						if ( ! $end_date) {
340 340
 							$month = 10;
341 341
 						} else {
342 342
 							$year -= 1;
343 343
 							$month  = 12;
344
-							$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
344
+							$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
345 345
 							$hour   = 23;
346 346
 							$minute = 59;
347 347
 							$second = 59;
348 348
 						}
349 349
 
350
-					} else if ( $month_now <= 6 ) {
350
+					} else if ($month_now <= 6) {
351 351
 
352
-						if ( ! $end_date ) {
352
+						if ( ! $end_date) {
353 353
 							$month = 1;
354 354
 						} else {
355 355
 							$month  = 3;
356
-							$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
356
+							$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
357 357
 							$hour   = 23;
358 358
 							$minute = 59;
359 359
 							$second = 59;
360 360
 						}
361 361
 
362
-					} else if ( $month_now <= 9 ) {
362
+					} else if ($month_now <= 9) {
363 363
 
364
-						if ( ! $end_date ) {
364
+						if ( ! $end_date) {
365 365
 							$month = 4;
366 366
 						} else {
367 367
 							$month  = 6;
368
-							$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
368
+							$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
369 369
 							$hour   = 23;
370 370
 							$minute = 59;
371 371
 							$second = 59;
@@ -373,11 +373,11 @@  discard block
 block discarded – undo
373 373
 
374 374
 					} else {
375 375
 
376
-						if ( ! $end_date ) {
376
+						if ( ! $end_date) {
377 377
 							$month = 7;
378 378
 						} else {
379 379
 							$month  = 9;
380
-							$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
380
+							$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
381 381
 							$hour   = 23;
382 382
 							$minute = 59;
383 383
 							$second = 59;
@@ -389,11 +389,11 @@  discard block
 block discarded – undo
389 389
 
390 390
 				case 'this_year' :
391 391
 
392
-					if ( ! $end_date ) {
392
+					if ( ! $end_date) {
393 393
 						$month = 1;
394 394
 					} else {
395 395
 						$month  = 12;
396
-						$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
396
+						$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
397 397
 						$hour   = 23;
398 398
 						$minute = 59;
399 399
 						$second = 59;
@@ -404,11 +404,11 @@  discard block
 block discarded – undo
404 404
 				case 'last_year' :
405 405
 
406 406
 					$year -= 1;
407
-					if ( ! $end_date ) {
407
+					if ( ! $end_date) {
408 408
 						$month = 1;
409 409
 					} else {
410 410
 						$month  = 12;
411
-						$day    = cal_days_in_month( CAL_GREGORIAN, $month, $year );
411
+						$day    = cal_days_in_month(CAL_GREGORIAN, $month, $year);
412 412
 						$hour   = 23;
413 413
 						$minute = 59;
414 414
 						$second = 59;
@@ -419,30 +419,30 @@  discard block
 block discarded – undo
419 419
 			}
420 420
 
421 421
 
422
-		} else if ( is_numeric( $date ) ) {
422
+		} else if (is_numeric($date)) {
423 423
 
424 424
 			// return $date unchanged since it is a timestamp
425 425
 			$this->timestamp = true;
426 426
 
427
-		} else if ( false !== strtotime( $date ) ) {
427
+		} else if (false !== strtotime($date)) {
428 428
 
429
-			$date  = strtotime( $date, current_time( 'timestamp' ) );
430
-			$year  = date( 'Y', $date );
431
-			$month = date( 'm', $date );
432
-			$day   = date( 'd', $date );
429
+			$date  = strtotime($date, current_time('timestamp'));
430
+			$year  = date('Y', $date);
431
+			$month = date('m', $date);
432
+			$day   = date('d', $date);
433 433
 
434 434
 		} else {
435 435
 
436
-			return new WP_Error( 'invalid_date', esc_html( 'Improper date provided.', 'give' ) );
436
+			return new WP_Error('invalid_date', esc_html('Improper date provided.', 'give'));
437 437
 
438 438
 		}
439 439
 
440
-		if ( false === $this->timestamp ) {
440
+		if (false === $this->timestamp) {
441 441
 			// Create an exact timestamp
442
-			$date = mktime( $hour, $minute, $second, $month, $day, $year );
442
+			$date = mktime($hour, $minute, $second, $month, $day, $year);
443 443
 		}
444 444
 
445
-		return apply_filters( 'give_stats_date', $date, $end_date, $this );
445
+		return apply_filters('give_stats_date', $date, $end_date, $this);
446 446
 
447 447
 	}
448 448
 
@@ -453,33 +453,33 @@  discard block
 block discarded – undo
453 453
 	 * @since  1.0
454 454
 	 * @return string
455 455
 	 */
456
-	public function count_where( $where = '' ) {
456
+	public function count_where($where = '') {
457 457
 		// Only get payments in our date range
458 458
 
459 459
 		$start_where = '';
460 460
 		$end_where   = '';
461 461
 
462
-		if ( $this->start_date ) {
462
+		if ($this->start_date) {
463 463
 
464
-			if ( $this->timestamp ) {
464
+			if ($this->timestamp) {
465 465
 				$format = 'Y-m-d H:i:s';
466 466
 			} else {
467 467
 				$format = 'Y-m-d 00:00:00';
468 468
 			}
469 469
 
470
-			$start_date  = date( $format, $this->start_date );
470
+			$start_date  = date($format, $this->start_date);
471 471
 			$start_where = " AND p.post_date >= '{$start_date}'";
472 472
 		}
473 473
 
474
-		if ( $this->end_date ) {
474
+		if ($this->end_date) {
475 475
 
476
-			if ( $this->timestamp ) {
476
+			if ($this->timestamp) {
477 477
 				$format = 'Y-m-d H:i:s';
478 478
 			} else {
479 479
 				$format = 'Y-m-d 23:59:59';
480 480
 			}
481 481
 
482
-			$end_date = date( $format, $this->end_date );
482
+			$end_date = date($format, $this->end_date);
483 483
 
484 484
 			$end_where = " AND p.post_date <= '{$end_date}'";
485 485
 		}
@@ -499,34 +499,34 @@  discard block
 block discarded – undo
499 499
 	 *
500 500
 	 * @return string
501 501
 	 */
502
-	public function payments_where( $where = '' ) {
502
+	public function payments_where($where = '') {
503 503
 
504 504
 		global $wpdb;
505 505
 
506 506
 		$start_where = '';
507 507
 		$end_where   = '';
508 508
 
509
-		if ( ! is_wp_error( $this->start_date ) ) {
509
+		if ( ! is_wp_error($this->start_date)) {
510 510
 
511
-			if ( $this->timestamp ) {
511
+			if ($this->timestamp) {
512 512
 				$format = 'Y-m-d H:i:s';
513 513
 			} else {
514 514
 				$format = 'Y-m-d 00:00:00';
515 515
 			}
516 516
 
517
-			$start_date  = date( $format, $this->start_date );
517
+			$start_date  = date($format, $this->start_date);
518 518
 			$start_where = " AND $wpdb->posts.post_date >= '{$start_date}'";
519 519
 		}
520 520
 
521
-		if ( ! is_wp_error( $this->end_date ) ) {
521
+		if ( ! is_wp_error($this->end_date)) {
522 522
 
523
-			if ( $this->timestamp ) {
523
+			if ($this->timestamp) {
524 524
 				$format = 'Y-m-d 00:00:00';
525 525
 			} else {
526 526
 				$format = 'Y-m-d 23:59:59';
527 527
 			}
528 528
 
529
-			$end_date = date( $format, $this->end_date );
529
+			$end_date = date($format, $this->end_date);
530 530
 
531 531
 			$end_where = " AND $wpdb->posts.post_date <= '{$end_date}'";
532 532
 		}
Please login to merge, or discard this patch.
includes/forms/template.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * @param array $args Arguments for display
23 23
  *
24
- * @return string $purchase_form
24
+ * @return false|null $purchase_form
25 25
  */
26 26
 function give_get_donation_form( $args = array() ) {
27 27
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
  * @param int   $form_id
1151 1151
  * @param array $args
1152 1152
  *
1153
- * @return mixed
1153
+ * @return boolean
1154 1154
  */
1155 1155
 
1156 1156
 function give_show_goal_progress( $form_id, $args ) {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1170,9 +1170,9 @@
 block discarded – undo
1170 1170
 
1171 1171
 	//Sanity check - ensure form has goal set to output
1172 1172
 	if ( empty( $form->ID )
1173
-	     || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' )
1174
-	     || $goal_option !== 'yes'
1175
-	     || $goal == 0
1173
+		 || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' )
1174
+		 || $goal_option !== 'yes'
1175
+		 || $goal == 0
1176 1176
 	) {
1177 1177
 		//not this form, bail
1178 1178
 		return false;
Please login to merge, or discard this patch.
Spacing   +405 added lines, -405 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,64 +23,64 @@  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
-	$form_id = is_object( $post ) ? $post->ID : 0;
30
+	$form_id = is_object($post) ? $post->ID : 0;
31 31
 
32
-	if ( isset( $args['id'] ) ) {
32
+	if (isset($args['id'])) {
33 33
 		$form_id = $args['id'];
34 34
 	}
35 35
 
36
-	$defaults = apply_filters( 'give_form_args_defaults', array(
36
+	$defaults = apply_filters('give_form_args_defaults', array(
37 37
 		'form_id' => $form_id
38
-	) );
38
+	));
39 39
 
40
-	$args = wp_parse_args( $args, $defaults );
40
+	$args = wp_parse_args($args, $defaults);
41 41
 
42
-	$form = new Give_Donate_Form( $args['form_id'] );
42
+	$form = new Give_Donate_Form($args['form_id']);
43 43
 
44 44
 	//bail if no form ID
45
-	if ( empty( $form->ID ) ) {
45
+	if (empty($form->ID)) {
46 46
 		return false;
47 47
 	}
48 48
 
49
-	$payment_mode = give_get_chosen_gateway( $form->ID );
49
+	$payment_mode = give_get_chosen_gateway($form->ID);
50 50
 
51
-	$form_action = 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 57
 	//Sanity Check: Donation form not published or user doesn't have permission to view drafts
58
-	if ( 'publish' !== $form->post_status && ! current_user_can( 'edit_give_forms', $form->ID ) ) {
58
+	if ('publish' !== $form->post_status && ! current_user_can('edit_give_forms', $form->ID)) {
59 59
 		return false;
60 60
 	}
61 61
 
62
-	$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )
62
+	$display_option = (isset($args['display_style']) && ! empty($args['display_style']))
63 63
 		? $args['display_style']
64
-		: get_post_meta( $form->ID, '_give_payment_display', true );
64
+		: get_post_meta($form->ID, '_give_payment_display', true);
65 65
 
66
-	$float_labels_option = give_is_float_labels_enabled( $args )
66
+	$float_labels_option = give_is_float_labels_enabled($args)
67 67
 		? ' float-labels-enabled'
68 68
 		: '';
69 69
 
70 70
 	//Form Wrap Classes
71
-	$form_wrap_classes_array = apply_filters( 'give_form_wrap_classes', array(
71
+	$form_wrap_classes_array = apply_filters('give_form_wrap_classes', array(
72 72
 		'give-form-wrap',
73
-		'give-display-' . $display_option
74
-	), $form->ID, $args );
75
-	$form_wrap_classes       = implode( ' ', $form_wrap_classes_array );
73
+		'give-display-'.$display_option
74
+	), $form->ID, $args);
75
+	$form_wrap_classes = implode(' ', $form_wrap_classes_array);
76 76
 
77 77
 	//Form Classes
78
-	$form_classes_array = apply_filters( 'give_form_classes', array(
78
+	$form_classes_array = apply_filters('give_form_classes', array(
79 79
 		'give-form',
80
-		'give-form-' . $form->ID,
80
+		'give-form-'.$form->ID,
81 81
 		$float_labels_option
82
-	), $form->ID, $args );
83
-	$form_classes       = implode( ' ', $form_classes_array );
82
+	), $form->ID, $args);
83
+	$form_classes = implode(' ', $form_classes_array);
84 84
 
85 85
 
86 86
 	ob_start();
@@ -93,35 +93,35 @@  discard block
 block discarded – undo
93 93
 	 * @param int $form ->ID The current form ID
94 94
 	 * @param array $args An array of form args
95 95
 	 */
96
-	do_action( 'give_pre_form_output', $form->ID, $args ); ?>
96
+	do_action('give_pre_form_output', $form->ID, $args); ?>
97 97
 
98 98
 	<div id="give-form-<?php echo $form->ID; ?>-wrap" class="<?php echo $form_wrap_classes; ?>">
99 99
 
100
-		<?php if ( $form->is_close_donation_form() ) {
100
+		<?php if ($form->is_close_donation_form()) {
101 101
 
102 102
 			//Get Goal thank you message.
103
-			$display_thankyou_message = get_post_meta( $form->ID, '_give_form_goal_achieved_message', true );
104
-			$display_thankyou_message = ! empty( $display_thankyou_message ) ? $display_thankyou_message : esc_html( 'Thank you to all our donors, we have met our fundraising goal.', 'give' );
103
+			$display_thankyou_message = get_post_meta($form->ID, '_give_form_goal_achieved_message', true);
104
+			$display_thankyou_message = ! empty($display_thankyou_message) ? $display_thankyou_message : esc_html('Thank you to all our donors, we have met our fundraising goal.', 'give');
105 105
 
106 106
 			//Print thank you message.
107
-			apply_filters( 'give_goal_closed_output', give_output_error( $display_thankyou_message, true, 'success' ) );
107
+			apply_filters('give_goal_closed_output', give_output_error($display_thankyou_message, true, 'success'));
108 108
 
109 109
 		} else {
110 110
 
111
-			if ( isset( $args['show_title'] ) && $args['show_title'] == true ) {
111
+			if (isset($args['show_title']) && $args['show_title'] == true) {
112 112
 
113
-				echo apply_filters( 'give_form_title', '<h2 class="give-form-title">' . get_the_title( $form_id ) . '</h2>' );
113
+				echo apply_filters('give_form_title', '<h2 class="give-form-title">'.get_the_title($form_id).'</h2>');
114 114
 
115 115
 			}
116 116
 
117
-			do_action( 'give_pre_form', $form->ID, $args ); ?>
117
+			do_action('give_pre_form', $form->ID, $args); ?>
118 118
 
119 119
 			<form id="give-form-<?php echo $form_id; ?>" class="<?php echo $form_classes; ?>" action="<?php echo $form_action; ?>" method="post">
120 120
 				<input type="hidden" name="give-form-id" value="<?php echo $form->ID; ?>"/>
121
-				<input type="hidden" name="give-form-title" value="<?php echo htmlentities( $form->post_title ); ?>"/>
122
-				<input type="hidden" name="give-current-url" value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/>
123
-				<input type="hidden" name="give-form-url" value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/>
124
-				<input type="hidden" name="give-form-minimum" value="<?php echo give_format_amount( give_get_form_minimum_price( $form->ID ) ); ?>"/>
121
+				<input type="hidden" name="give-form-title" value="<?php echo htmlentities($form->post_title); ?>"/>
122
+				<input type="hidden" name="give-current-url" value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/>
123
+				<input type="hidden" name="give-form-url" value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/>
124
+				<input type="hidden" name="give-form-minimum" value="<?php echo give_format_amount(give_get_form_minimum_price($form->ID)); ?>"/>
125 125
 
126 126
 				<!-- The following field is for robots only, invisible to humans: -->
127 127
 				<span class="give-hidden" style="display: none !important;">
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 				<?php
133 133
 
134 134
 				//Price ID hidden field for variable (mult-level) donation forms
135
-				if ( give_has_variable_prices( $form_id ) ) {
135
+				if (give_has_variable_prices($form_id)) {
136 136
 					//get default selected price ID
137
-					$prices   = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
137
+					$prices   = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id);
138 138
 					$price_id = 0;
139 139
 					//loop through prices
140
-					foreach ( $prices as $price ) {
141
-						if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
140
+					foreach ($prices as $price) {
141
+						if (isset($price['_give_default']) && $price['_give_default'] === 'default') {
142 142
 							$price_id = $price['_give_id']['level_id'];
143 143
 						};
144 144
 					}
@@ -146,20 +146,20 @@  discard block
 block discarded – undo
146 146
 					<input type="hidden" name="give-price-id" value="<?php echo $price_id; ?>"/>
147 147
 				<?php }
148 148
 
149
-				do_action( 'give_checkout_form_top', $form->ID, $args );
149
+				do_action('give_checkout_form_top', $form->ID, $args);
150 150
 
151
-				do_action( 'give_payment_mode_select', $form->ID, $args );
151
+				do_action('give_payment_mode_select', $form->ID, $args);
152 152
 
153
-				do_action( 'give_checkout_form_bottom', $form->ID, $args );
153
+				do_action('give_checkout_form_bottom', $form->ID, $args);
154 154
 
155 155
 				?>
156 156
 			</form>
157 157
 
158
-			<?php do_action( 'give_post_form', $form->ID, $args ); ?>
158
+			<?php do_action('give_post_form', $form->ID, $args); ?>
159 159
 
160 160
 		<?php } ?>
161 161
 
162
-		<!--end #give-form-<?php echo absint( $form->ID ); ?>--></div>
162
+		<!--end #give-form-<?php echo absint($form->ID); ?>--></div>
163 163
 	<?php
164 164
 
165 165
 	/**
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
 	 * @param int $form ->ID The current form ID
171 171
 	 * @param array $args An array of form args
172 172
 	 */
173
-	do_action( 'give_post_form_output', $form->ID, $args );
173
+	do_action('give_post_form_output', $form->ID, $args);
174 174
 
175 175
 	$final_output = ob_get_clean();
176 176
 
177
-	echo apply_filters( 'give_donate_form', $final_output, $args );
177
+	echo apply_filters('give_donate_form', $final_output, $args);
178 178
 }
179 179
 
180 180
 
@@ -194,43 +194,43 @@  discard block
 block discarded – undo
194 194
  * @global    $give_options Array of all the Give options
195 195
  * @return string
196 196
  */
197
-function give_show_purchase_form( $form_id ) {
197
+function give_show_purchase_form($form_id) {
198 198
 
199
-	$payment_mode = give_get_chosen_gateway( $form_id );
199
+	$payment_mode = give_get_chosen_gateway($form_id);
200 200
 
201
-	if ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) {
201
+	if ( ! isset($form_id) && isset($_POST['give_form_id'])) {
202 202
 		$form_id = $_POST['give_form_id'];
203 203
 	}
204 204
 
205
-	do_action( 'give_purchase_form_top', $form_id );
205
+	do_action('give_purchase_form_top', $form_id);
206 206
 
207
-	if ( give_can_checkout() && isset( $form_id ) ) {
207
+	if (give_can_checkout() && isset($form_id)) {
208 208
 
209
-		do_action( 'give_purchase_form_before_register_login', $form_id );
209
+		do_action('give_purchase_form_before_register_login', $form_id);
210 210
 
211
-		do_action( 'give_purchase_form_register_login_fields', $form_id );
211
+		do_action('give_purchase_form_register_login_fields', $form_id);
212 212
 
213
-		do_action( 'give_purchase_form_before_cc_form', $form_id );
213
+		do_action('give_purchase_form_before_cc_form', $form_id);
214 214
 
215 215
 		// Load the credit card form and allow gateways to load their own if they wish
216
-		if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) {
217
-			do_action( 'give_' . $payment_mode . '_cc_form', $form_id );
216
+		if (has_action('give_'.$payment_mode.'_cc_form')) {
217
+			do_action('give_'.$payment_mode.'_cc_form', $form_id);
218 218
 		} else {
219
-			do_action( 'give_cc_form', $form_id );
219
+			do_action('give_cc_form', $form_id);
220 220
 		}
221 221
 
222
-		do_action( 'give_purchase_form_after_cc_form', $form_id );
222
+		do_action('give_purchase_form_after_cc_form', $form_id);
223 223
 
224 224
 	} else {
225 225
 		// Can't checkout
226
-		do_action( 'give_purchase_form_no_access', $form_id );
226
+		do_action('give_purchase_form_no_access', $form_id);
227 227
 
228 228
 	}
229 229
 
230
-	do_action( 'give_purchase_form_bottom', $form_id );
230
+	do_action('give_purchase_form_bottom', $form_id);
231 231
 }
232 232
 
233
-add_action( 'give_purchase_form', 'give_show_purchase_form' );
233
+add_action('give_purchase_form', 'give_show_purchase_form');
234 234
 
235 235
 /**
236 236
  *
@@ -242,26 +242,26 @@  discard block
 block discarded – undo
242 242
  *
243 243
  * @return void
244 244
  */
245
-function give_show_register_login_fields( $form_id ) {
245
+function give_show_register_login_fields($form_id) {
246 246
 
247
-	$show_register_form = give_show_login_register_option( $form_id );
247
+	$show_register_form = give_show_login_register_option($form_id);
248 248
 
249
-	if ( ( $show_register_form === 'registration' || ( $show_register_form === 'both' && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?>
249
+	if (($show_register_form === 'registration' || ($show_register_form === 'both' && ! isset($_GET['login']))) && ! is_user_logged_in()) : ?>
250 250
 		<div id="give-checkout-login-register-<?php echo $form_id; ?>">
251
-			<?php do_action( 'give_purchase_form_register_fields', $form_id ); ?>
251
+			<?php do_action('give_purchase_form_register_fields', $form_id); ?>
252 252
 		</div>
253
-	<?php elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?>
253
+	<?php elseif (($show_register_form === 'login' || ($show_register_form === 'both' && isset($_GET['login']))) && ! is_user_logged_in()) : ?>
254 254
 		<div id="give-checkout-login-register-<?php echo $form_id; ?>">
255
-			<?php do_action( 'give_purchase_form_login_fields', $form_id ); ?>
255
+			<?php do_action('give_purchase_form_login_fields', $form_id); ?>
256 256
 		</div>
257 257
 	<?php endif; ?>
258 258
 
259
-	<?php if ( ( ! isset( $_GET['login'] ) && is_user_logged_in() ) || ! isset( $show_register_form ) || 'none' === $show_register_form || 'login' === $show_register_form ) {
260
-		do_action( 'give_purchase_form_after_user_info', $form_id );
259
+	<?php if (( ! isset($_GET['login']) && is_user_logged_in()) || ! isset($show_register_form) || 'none' === $show_register_form || 'login' === $show_register_form) {
260
+		do_action('give_purchase_form_after_user_info', $form_id);
261 261
 	}
262 262
 }
263 263
 
264
-add_action( 'give_purchase_form_register_login_fields', 'give_show_register_login_fields' );
264
+add_action('give_purchase_form_register_login_fields', 'give_show_register_login_fields');
265 265
 
266 266
 /**
267 267
  * Donation Amount Field
@@ -275,33 +275,33 @@  discard block
 block discarded – undo
275 275
  *
276 276
  * @return void
277 277
  */
278
-function give_output_donation_amount_top( $form_id = 0, $args = array() ) {
278
+function give_output_donation_amount_top($form_id = 0, $args = array()) {
279 279
 
280 280
 	global $give_options;
281 281
 
282
-	$variable_pricing    = give_has_variable_prices( $form_id );
283
-	$allow_custom_amount = get_post_meta( $form_id, '_give_custom_amount', true );
284
-	$currency_position   = isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before';
285
-	$symbol              = give_currency_symbol( give_get_currency() );
286
-	$currency_output     = '<span class="give-currency-symbol give-currency-position-' . $currency_position . '">' . $symbol . '</span>';
287
-	$default_amount      = give_format_amount( give_get_default_form_amount( $form_id ) );
288
-	$custom_amount_text  = get_post_meta( $form_id, '_give_custom_amount_text', true );
282
+	$variable_pricing    = give_has_variable_prices($form_id);
283
+	$allow_custom_amount = get_post_meta($form_id, '_give_custom_amount', true);
284
+	$currency_position   = isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before';
285
+	$symbol              = give_currency_symbol(give_get_currency());
286
+	$currency_output     = '<span class="give-currency-symbol give-currency-position-'.$currency_position.'">'.$symbol.'</span>';
287
+	$default_amount      = give_format_amount(give_get_default_form_amount($form_id));
288
+	$custom_amount_text  = get_post_meta($form_id, '_give_custom_amount_text', true);
289 289
 
290
-	do_action( 'give_before_donation_levels', $form_id, $args );
290
+	do_action('give_before_donation_levels', $form_id, $args);
291 291
 
292 292
 	//Set Price, No Custom Amount Allowed means hidden price field
293
-	if ( $allow_custom_amount == 'no' ) {
293
+	if ($allow_custom_amount == 'no') {
294 294
 		?>
295 295
 
296
-		<label class="give-hidden" for="give-amount-hidden"><?php esc_html_e( 'Donation Amount:', 'give' ); ?></label>
296
+		<label class="give-hidden" for="give-amount-hidden"><?php esc_html_e('Donation Amount:', 'give'); ?></label>
297 297
 		<input id="give-amount" class="give-amount-hidden" type="hidden" name="give-amount"
298 298
 		       value="<?php echo $default_amount; ?>" required>
299 299
 		<div class="set-price give-donation-amount form-row-wide">
300
-			<?php if ( $currency_position == 'before' ) {
300
+			<?php if ($currency_position == 'before') {
301 301
 				echo $currency_output;
302 302
 			} ?>
303 303
 			<span id="give-amount-text" class="give-text-input give-amount-top"><?php echo $default_amount; ?></span>
304
-			<?php if ( $currency_position == 'after' ) {
304
+			<?php if ($currency_position == 'after') {
305 305
 				echo $currency_output;
306 306
 			} ?>
307 307
 		</div>
@@ -311,34 +311,34 @@  discard block
 block discarded – undo
311 311
 		?>
312 312
 		<div class="give-total-wrap">
313 313
 			<div class="give-donation-amount form-row-wide">
314
-				<?php if ( $currency_position == 'before' ) {
314
+				<?php if ($currency_position == 'before') {
315 315
 					echo $currency_output;
316 316
 				} ?>
317
-				<label class="give-hidden" for="give-amount"><?php esc_html_e( 'Donation Amount:', 'give' ); ?></label>
317
+				<label class="give-hidden" for="give-amount"><?php esc_html_e('Donation Amount:', 'give'); ?></label>
318 318
 				<input class="give-text-input give-amount-top" id="give-amount" name="give-amount" type="tel" placeholder="" value="<?php echo $default_amount; ?>" autocomplete="off">
319
-				<?php if ( $currency_position == 'after' ) {
319
+				<?php if ($currency_position == 'after') {
320 320
 					echo $currency_output;
321 321
 				} ?>
322 322
 			</div>
323 323
 		</div>
324 324
 	<?php }
325 325
 
326
-	do_action( 'give_after_donation_amount', $form_id, $args );
326
+	do_action('give_after_donation_amount', $form_id, $args);
327 327
 
328 328
 	//Custom Amount Text
329
-	if ( ! $variable_pricing && $allow_custom_amount == 'yes' && ! empty( $custom_amount_text ) ) { ?>
329
+	if ( ! $variable_pricing && $allow_custom_amount == 'yes' && ! empty($custom_amount_text)) { ?>
330 330
 		<p class="give-custom-amount-text"><?php echo $custom_amount_text; ?></p>
331 331
 	<?php }
332 332
 
333 333
 	//Output Variable Pricing Levels
334
-	if ( $variable_pricing ) {
335
-		give_output_levels( $form_id );
334
+	if ($variable_pricing) {
335
+		give_output_levels($form_id);
336 336
 	}
337 337
 
338
-	do_action( 'give_after_donation_levels', $form_id, $args );
338
+	do_action('give_after_donation_levels', $form_id, $args);
339 339
 }
340 340
 
341
-add_action( 'give_checkout_form_top', 'give_output_donation_amount_top', 10, 2 );
341
+add_action('give_checkout_form_top', 'give_output_donation_amount_top', 10, 2);
342 342
 
343 343
 
344 344
 /**
@@ -350,32 +350,32 @@  discard block
 block discarded – undo
350 350
  *
351 351
  * @return string
352 352
  */
353
-function give_output_levels( $form_id ) {
353
+function give_output_levels($form_id) {
354 354
 
355 355
 	//Get variable pricing
356
-	$prices             = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
357
-	$display_style      = get_post_meta( $form_id, '_give_display_style', true );
358
-	$custom_amount      = get_post_meta( $form_id, '_give_custom_amount', true );
359
-	$custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true );
360
-	if ( empty( $custom_amount_text ) ) {
361
-		$custom_amount_text = esc_html( 'Give a Custom Amount', 'give' );
356
+	$prices             = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id);
357
+	$display_style      = get_post_meta($form_id, '_give_display_style', true);
358
+	$custom_amount      = get_post_meta($form_id, '_give_custom_amount', true);
359
+	$custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true);
360
+	if (empty($custom_amount_text)) {
361
+		$custom_amount_text = esc_html('Give a Custom Amount', 'give');
362 362
 	}
363 363
 
364 364
 	$output  = '';
365 365
 	$counter = 0;
366 366
 
367
-	switch ( $display_style ) {
367
+	switch ($display_style) {
368 368
 		case 'buttons':
369 369
 
370 370
 			$output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">';
371 371
 
372
-			foreach ( $prices as $price ) {
373
-				$counter ++;
374
-				$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 );
375
-				$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 );
372
+			foreach ($prices as $price) {
373
+				$counter++;
374
+				$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);
375
+				$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);
376 376
 
377 377
 				$output .= '<li>';
378
-				$output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'] ) . '">';
378
+				$output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount']).'">';
379 379
 				$output .= $level_text;
380 380
 				$output .= '</button>';
381 381
 				$output .= '</li>';
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			}
384 384
 
385 385
 			//Custom Amount
386
-			if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) {
386
+			if ($custom_amount === 'yes' && ! empty($custom_amount_text)) {
387 387
 				$output .= '<li>';
388 388
 				$output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">';
389 389
 				$output .= $custom_amount_text;
@@ -399,23 +399,23 @@  discard block
 block discarded – undo
399 399
 
400 400
 			$output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">';
401 401
 
402
-			foreach ( $prices as $price ) {
403
-				$counter ++;
404
-				$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 );
405
-				$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 );
402
+			foreach ($prices as $price) {
403
+				$counter++;
404
+				$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);
405
+				$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);
406 406
 
407 407
 				$output .= '<li>';
408
-				$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'] ) . '">';
409
-				$output .= '<label for="give-radio-level-' . $counter . '">' . $level_text . '</label>';
408
+				$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']).'">';
409
+				$output .= '<label for="give-radio-level-'.$counter.'">'.$level_text.'</label>';
410 410
 				$output .= '</li>';
411 411
 
412 412
 			}
413 413
 
414 414
 			//Custom Amount
415
-			if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) {
415
+			if ($custom_amount === 'yes' && ! empty($custom_amount_text)) {
416 416
 				$output .= '<li>';
417 417
 				$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">';
418
-				$output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>';
418
+				$output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>';
419 419
 				$output .= '</li>';
420 420
 			}
421 421
 
@@ -425,23 +425,23 @@  discard block
 block discarded – undo
425 425
 
426 426
 		case 'dropdown':
427 427
 
428
-			$output .= '<label for="give-donation-level" class="give-hidden">' . esc_html( 'Choose Your Donation Amount', 'give' ) . ':</label>';
429
-			$output .= '<select id="give-donation-level-' . $form_id . '" class="give-select give-select-level">';
428
+			$output .= '<label for="give-donation-level" class="give-hidden">'.esc_html('Choose Your Donation Amount', 'give').':</label>';
429
+			$output .= '<select id="give-donation-level-'.$form_id.'" class="give-select give-select-level">';
430 430
 
431 431
 			//first loop through prices
432
-			foreach ( $prices as $price ) {
433
-				$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 );
434
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $form_id . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
432
+			foreach ($prices as $price) {
433
+				$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);
434
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$form_id.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price);
435 435
 
436
-				$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'] ) . '">';
436
+				$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']).'">';
437 437
 				$output .= $level_text;
438 438
 				$output .= '</option>';
439 439
 
440 440
 			}
441 441
 
442 442
 			//Custom Amount
443
-			if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) {
444
-				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>';
443
+			if ($custom_amount === 'yes' && ! empty($custom_amount_text)) {
444
+				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>';
445 445
 			}
446 446
 
447 447
 			$output .= '</select>';
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 			break;
450 450
 	}
451 451
 
452
-	echo apply_filters( 'give_form_level_output', $output, $form_id );
452
+	echo apply_filters('give_form_level_output', $output, $form_id);
453 453
 }
454 454
 
455 455
 /**
@@ -461,26 +461,26 @@  discard block
 block discarded – undo
461 461
  * @param array $args
462 462
  *
463 463
  */
464
-function give_display_checkout_button( $form_id, $args ) {
464
+function give_display_checkout_button($form_id, $args) {
465 465
 
466
-	$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )
466
+	$display_option = (isset($args['display_style']) && ! empty($args['display_style']))
467 467
 		? $args['display_style']
468
-		: get_post_meta( $form_id, '_give_payment_display', true );
468
+		: get_post_meta($form_id, '_give_payment_display', true);
469 469
 
470 470
 	//no btn for onpage
471
-	if ( $display_option === 'onpage' ) {
471
+	if ($display_option === 'onpage') {
472 472
 		return;
473 473
 	}
474 474
 
475
-	$display_label_field = get_post_meta( $form_id, '_give_reveal_label', true );
476
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : esc_html( 'Donate Now', 'give' ) );
475
+	$display_label_field = get_post_meta($form_id, '_give_reveal_label', true);
476
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : esc_html('Donate Now', 'give'));
477 477
 
478
-	$output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>';
478
+	$output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>';
479 479
 
480
-	echo apply_filters( 'give_display_checkout_button', $output );
480
+	echo apply_filters('give_display_checkout_button', $output);
481 481
 }
482 482
 
483
-add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 );
483
+add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2);
484 484
 
485 485
 /**
486 486
  * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided.
@@ -491,71 +491,71 @@  discard block
 block discarded – undo
491 491
  *
492 492
  * @return void
493 493
  */
494
-function give_user_info_fields( $form_id ) {
494
+function give_user_info_fields($form_id) {
495 495
 
496
-	if ( is_user_logged_in() ) :
497
-		$user_data = get_userdata( get_current_user_id() );
496
+	if (is_user_logged_in()) :
497
+		$user_data = get_userdata(get_current_user_id());
498 498
 	endif;
499 499
 
500
-	do_action( 'give_purchase_form_before_personal_info', $form_id );
500
+	do_action('give_purchase_form_before_personal_info', $form_id);
501 501
 	?>
502 502
 	<fieldset id="give_checkout_user_info">
503
-		<legend><?php echo apply_filters( 'give_checkout_personal_info_text', esc_html( 'Personal Info', 'give' ) ); ?></legend>
503
+		<legend><?php echo apply_filters('give_checkout_personal_info_text', esc_html('Personal Info', 'give')); ?></legend>
504 504
 		<p id="give-first-name-wrap" class="form-row form-row-first">
505 505
 			<label class="give-label" for="give-first">
506
-				<?php esc_html_e( 'First Name', 'give' ); ?>
507
-				<?php if ( give_field_is_required( 'give_first', $form_id ) ) { ?>
506
+				<?php esc_html_e('First Name', 'give'); ?>
507
+				<?php if (give_field_is_required('give_first', $form_id)) { ?>
508 508
 					<span class="give-required-indicator">*</span>
509 509
 				<?php } ?>
510
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span>
510
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('We will use this to personalize your account experience.', 'give'); ?>"></span>
511 511
 			</label>
512
-			<input class="give-input required" type="text" name="give_first" placeholder="<?php esc_attr_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 ) ) {
512
+			<input class="give-input required" type="text" name="give_first" placeholder="<?php esc_attr_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)) {
513 513
 				echo ' required ';
514 514
 			} ?>/>
515 515
 		</p>
516 516
 
517 517
 		<p id="give-last-name-wrap" class="form-row form-row-last">
518 518
 			<label class="give-label" for="give-last">
519
-				<?php esc_html_e( 'Last Name', 'give' ); ?>
520
-				<?php if ( give_field_is_required( 'give_last', $form_id ) ) { ?>
519
+				<?php esc_html_e('Last Name', 'give'); ?>
520
+				<?php if (give_field_is_required('give_last', $form_id)) { ?>
521 521
 					<span class="give-required-indicator">*</span>
522 522
 				<?php } ?>
523
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'We will use this as well to personalize your account experience.', 'give' ); ?>"></span>
523
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('We will use this as well to personalize your account experience.', 'give'); ?>"></span>
524 524
 			</label>
525 525
 
526
-			<input class="give-input<?php if ( give_field_is_required( 'give_last', $form_id ) ) {
526
+			<input class="give-input<?php if (give_field_is_required('give_last', $form_id)) {
527 527
 				echo ' required';
528
-			} ?>" type="text" name="give_last" id="give-last" placeholder="<?php esc_attr_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 ) ) {
528
+			} ?>" type="text" name="give_last" id="give-last" placeholder="<?php esc_attr_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)) {
529 529
 				echo ' required ';
530 530
 			} ?> />
531 531
 		</p>
532 532
 
533
-		<?php do_action( 'give_purchase_form_before_email', $form_id ); ?>
533
+		<?php do_action('give_purchase_form_before_email', $form_id); ?>
534 534
 		<p id="give-email-wrap" class="form-row form-row-wide">
535 535
 			<label class="give-label" for="give-email">
536
-				<?php esc_html_e( 'Email Address', 'give' ); ?>
537
-				<?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?>
536
+				<?php esc_html_e('Email Address', 'give'); ?>
537
+				<?php if (give_field_is_required('give_email', $form_id)) { ?>
538 538
 					<span class="give-required-indicator">*</span>
539 539
 				<?php } ?>
540
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'We will send the purchase receipt to this address.', 'give' ); ?>"></span>
540
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('We will send the purchase receipt to this address.', 'give'); ?>"></span>
541 541
 			</label>
542 542
 
543
-			<input class="give-input required" type="email" name="give_email" placeholder="<?php esc_attr_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 ) ) {
543
+			<input class="give-input required" type="email" name="give_email" placeholder="<?php esc_attr_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)) {
544 544
 				echo ' required ';
545 545
 			} ?>/>
546 546
 
547 547
 		</p>
548
-		<?php do_action( 'give_purchase_form_after_email', $form_id ); ?>
548
+		<?php do_action('give_purchase_form_after_email', $form_id); ?>
549 549
 
550
-		<?php do_action( 'give_purchase_form_user_info', $form_id ); ?>
550
+		<?php do_action('give_purchase_form_user_info', $form_id); ?>
551 551
 	</fieldset>
552 552
 	<?php
553
-	do_action( 'give_purchase_form_after_personal_info', $form_id );
553
+	do_action('give_purchase_form_after_personal_info', $form_id);
554 554
 
555 555
 }
556 556
 
557
-add_action( 'give_purchase_form_after_user_info', 'give_user_info_fields' );
558
-add_action( 'give_register_fields_before', 'give_user_info_fields' );
557
+add_action('give_purchase_form_after_user_info', 'give_user_info_fields');
558
+add_action('give_register_fields_before', 'give_user_info_fields');
559 559
 
560 560
 /**
561 561
  * Renders the credit card info form.
@@ -566,73 +566,73 @@  discard block
 block discarded – undo
566 566
  *
567 567
  * @return void
568 568
  */
569
-function give_get_cc_form( $form_id ) {
569
+function give_get_cc_form($form_id) {
570 570
 
571 571
 	ob_start();
572 572
 
573
-	do_action( 'give_before_cc_fields', $form_id ); ?>
573
+	do_action('give_before_cc_fields', $form_id); ?>
574 574
 
575 575
 	<fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate">
576
-		<legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html( 'Credit Card Info', 'give' ) ); ?></legend>
577
-		<?php if ( is_ssl() ) : ?>
576
+		<legend><?php echo apply_filters('give_credit_card_fieldset_heading', esc_html('Credit Card Info', 'give')); ?></legend>
577
+		<?php if (is_ssl()) : ?>
578 578
 			<div id="give_secure_site_wrapper-<?php echo $form_id ?>">
579 579
 				<span class="give-icon padlock"></span>
580
-				<span><?php esc_html_e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>
580
+				<span><?php esc_html_e('This is a secure SSL encrypted payment.', 'give'); ?></span>
581 581
 			</div>
582 582
 		<?php endif; ?>
583 583
 		<p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds">
584 584
 			<label for="card_number-<?php echo $form_id ?>" class="give-label">
585
-				<?php esc_html_e( 'Card Number', 'give' ); ?>
585
+				<?php esc_html_e('Card Number', 'give'); ?>
586 586
 				<span class="give-required-indicator">*</span>
587
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span>
587
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The (typically) 16 digits on the front of your credit card.', 'give'); ?>"></span>
588 588
 				<span class="card-type"></span>
589 589
 			</label>
590 590
 
591
-			<input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>" class="card-number give-input required" placeholder="<?php esc_attr_e( 'Card number', 'give' ); ?>" required/>
591
+			<input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>" class="card-number give-input required" placeholder="<?php esc_attr_e('Card number', 'give'); ?>" required/>
592 592
 		</p>
593 593
 
594 594
 		<p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third">
595 595
 			<label for="card_cvc-<?php echo $form_id ?>" class="give-label">
596
-				<?php esc_html_e( 'CVC', 'give' ); ?>
596
+				<?php esc_html_e('CVC', 'give'); ?>
597 597
 				<span class="give-required-indicator">*</span>
598
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ); ?>"></span>
598
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The 3 digit (back) or 4 digit (front) value on your card.', 'give'); ?>"></span>
599 599
 			</label>
600 600
 
601
-			<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 esc_attr_e( 'Security code', 'give' ); ?>" required/>
601
+			<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 esc_attr_e('Security code', 'give'); ?>" required/>
602 602
 		</p>
603 603
 
604 604
 		<p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds">
605 605
 			<label for="card_name-<?php echo $form_id ?>" class="give-label">
606
-				<?php esc_html_e( 'Name on the Card', 'give' ); ?>
606
+				<?php esc_html_e('Name on the Card', 'give'); ?>
607 607
 				<span class="give-required-indicator">*</span>
608
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The name printed on the front of your credit card.', 'give' ); ?>"></span>
608
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The name printed on the front of your credit card.', 'give'); ?>"></span>
609 609
 			</label>
610 610
 
611
-			<input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>" class="card-name give-input required" placeholder="<?php esc_attr_e( 'Card name', 'give' ); ?>" required/>
611
+			<input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>" class="card-name give-input required" placeholder="<?php esc_attr_e('Card name', 'give'); ?>" required/>
612 612
 		</p>
613
-		<?php do_action( 'give_before_cc_expiration' ); ?>
613
+		<?php do_action('give_before_cc_expiration'); ?>
614 614
 		<p class="card-expiration form-row form-row-one-third">
615 615
 			<label for="card_expiry-<?php echo $form_id ?>" class="give-label">
616
-				<?php esc_html_e( 'Expiration', 'give' ); ?>
616
+				<?php esc_html_e('Expiration', 'give'); ?>
617 617
 				<span class="give-required-indicator">*</span>
618
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The date your credit card expires, typically on the front of the card.', 'give' ); ?>"></span>
618
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The date your credit card expires, typically on the front of the card.', 'give'); ?>"></span>
619 619
 			</label>
620 620
 
621 621
 			<input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month" class="card-expiry-month"/>
622 622
 			<input type="hidden" id="card_exp_year-<?php echo $form_id ?>" name="card_exp_year" class="card-expiry-year"/>
623 623
 
624
-			<input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>" class="card-expiry give-input required" placeholder="<?php esc_attr_e( 'MM / YY', 'give' ); ?>" required/>
624
+			<input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>" class="card-expiry give-input required" placeholder="<?php esc_attr_e('MM / YY', 'give'); ?>" required/>
625 625
 		</p>
626
-		<?php do_action( 'give_after_cc_expiration', $form_id ); ?>
626
+		<?php do_action('give_after_cc_expiration', $form_id); ?>
627 627
 
628 628
 	</fieldset>
629 629
 	<?php
630
-	do_action( 'give_after_cc_fields', $form_id );
630
+	do_action('give_after_cc_fields', $form_id);
631 631
 
632 632
 	echo ob_get_clean();
633 633
 }
634 634
 
635
-add_action( 'give_cc_form', 'give_get_cc_form' );
635
+add_action('give_cc_form', 'give_get_cc_form');
636 636
 
637 637
 /**
638 638
  * Outputs the default credit card address fields
@@ -643,110 +643,110 @@  discard block
 block discarded – undo
643 643
  *
644 644
  * @return void
645 645
  */
646
-function give_default_cc_address_fields( $form_id ) {
646
+function give_default_cc_address_fields($form_id) {
647 647
 
648 648
 	$logged_in = is_user_logged_in();
649 649
 
650
-	if ( $logged_in ) {
651
-		$user_address = get_user_meta( get_current_user_id(), '_give_user_address', true );
650
+	if ($logged_in) {
651
+		$user_address = get_user_meta(get_current_user_id(), '_give_user_address', true);
652 652
 	}
653
-	$line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : '';
654
-	$line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : '';
655
-	$city  = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : '';
656
-	$zip   = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : '';
653
+	$line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : '';
654
+	$line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : '';
655
+	$city  = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : '';
656
+	$zip   = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : '';
657 657
 	ob_start(); ?>
658 658
 	<fieldset id="give_cc_address" class="cc-address">
659
-		<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html( 'Billing Details', 'give' ) ); ?></legend>
660
-		<?php do_action( 'give_cc_billing_top' ); ?>
659
+		<legend><?php echo apply_filters('give_billing_details_fieldset_heading', esc_html('Billing Details', 'give')); ?></legend>
660
+		<?php do_action('give_cc_billing_top'); ?>
661 661
 		<p id="give-card-address-wrap" class="form-row form-row-two-thirds">
662 662
 			<label for="card_address" class="give-label">
663
-				<?php esc_html_e( 'Address', 'give' ); ?>
663
+				<?php esc_html_e('Address', 'give'); ?>
664 664
 				<?php
665
-				if ( give_field_is_required( 'card_address', $form_id ) ) { ?>
665
+				if (give_field_is_required('card_address', $form_id)) { ?>
666 666
 					<span class="give-required-indicator">*</span>
667 667
 				<?php } ?>
668
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The primary billing address for your credit card.', 'give' ); ?>"></span>
668
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The primary billing address for your credit card.', 'give'); ?>"></span>
669 669
 			</label>
670 670
 
671
-			<input type="text" id="card_address" name="card_address" class="card-address give-input<?php if ( give_field_is_required( 'card_address', $form_id ) ) {
671
+			<input type="text" id="card_address" name="card_address" class="card-address give-input<?php if (give_field_is_required('card_address', $form_id)) {
672 672
 				echo ' required';
673
-			} ?>" placeholder="<?php esc_attr_e( 'Address line 1', 'give' ); ?>" value="<?php echo $line1; ?>"<?php if ( give_field_is_required( 'card_address', $form_id ) ) {
673
+			} ?>" placeholder="<?php esc_attr_e('Address line 1', 'give'); ?>" value="<?php echo $line1; ?>"<?php if (give_field_is_required('card_address', $form_id)) {
674 674
 				echo '  required ';
675 675
 			} ?>/>
676 676
 		</p>
677 677
 
678 678
 		<p id="give-card-address-2-wrap" class="form-row form-row-one-third">
679 679
 			<label for="card_address_2" class="give-label">
680
-				<?php esc_html_e( 'Address Line 2', 'give' ); ?>
681
-				<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { ?>
680
+				<?php esc_html_e('Address Line 2', 'give'); ?>
681
+				<?php if (give_field_is_required('card_address_2', $form_id)) { ?>
682 682
 					<span class="give-required-indicator">*</span>
683 683
 				<?php } ?>
684
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( '(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give' ); ?>"></span>
684
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give'); ?>"></span>
685 685
 			</label>
686 686
 
687
-			<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 ) ) {
687
+			<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)) {
688 688
 				echo ' required';
689
-			} ?>" placeholder="<?php esc_attr_e( 'Address line 2', 'give' ); ?>" value="<?php echo $line2; ?>"<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) {
689
+			} ?>" placeholder="<?php esc_attr_e('Address line 2', 'give'); ?>" value="<?php echo $line2; ?>"<?php if (give_field_is_required('card_address_2', $form_id)) {
690 690
 				echo ' required ';
691 691
 			} ?>/>
692 692
 		</p>
693 693
 
694 694
 		<p id="give-card-city-wrap" class="form-row form-row-two-thirds">
695 695
 			<label for="card_city" class="give-label">
696
-				<?php esc_html_e( 'City', 'give' ); ?>
697
-				<?php if ( give_field_is_required( 'card_city', $form_id ) ) { ?>
696
+				<?php esc_html_e('City', 'give'); ?>
697
+				<?php if (give_field_is_required('card_city', $form_id)) { ?>
698 698
 					<span class="give-required-indicator">*</span>
699 699
 				<?php } ?>
700
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The city for your billing address.', 'give' ); ?>"></span>
700
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The city for your billing address.', 'give'); ?>"></span>
701 701
 			</label>
702
-			<input type="text" id="card_city" name="card_city" class="card-city give-input<?php if ( give_field_is_required( 'card_city', $form_id ) ) {
702
+			<input type="text" id="card_city" name="card_city" class="card-city give-input<?php if (give_field_is_required('card_city', $form_id)) {
703 703
 				echo ' required';
704
-			} ?>" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $city; ?>"<?php if ( give_field_is_required( 'card_city', $form_id ) ) {
704
+			} ?>" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $city; ?>"<?php if (give_field_is_required('card_city', $form_id)) {
705 705
 				echo ' required ';
706 706
 			} ?>/>
707 707
 		</p>
708 708
 
709 709
 		<p id="give-card-zip-wrap" class="form-row form-row-one-third">
710 710
 			<label for="card_zip" class="give-label">
711
-				<?php esc_html_e( 'Zip / Postal Code', 'give' ); ?>
712
-				<?php if ( give_field_is_required( 'card_zip', $form_id ) ) { ?>
711
+				<?php esc_html_e('Zip / Postal Code', 'give'); ?>
712
+				<?php if (give_field_is_required('card_zip', $form_id)) { ?>
713 713
 					<span class="give-required-indicator">*</span>
714 714
 				<?php } ?>
715
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span>
715
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The zip or postal code for your billing address.', 'give'); ?>"></span>
716 716
 			</label>
717 717
 
718
-			<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 ) ) {
718
+			<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)) {
719 719
 				echo ' required';
720
-			} ?>" placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $zip; ?>" <?php if ( give_field_is_required( 'card_zip', $form_id ) ) {
720
+			} ?>" placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>" value="<?php echo $zip; ?>" <?php if (give_field_is_required('card_zip', $form_id)) {
721 721
 				echo ' required ';
722 722
 			} ?>/>
723 723
 		</p>
724 724
 
725 725
 		<p id="give-card-country-wrap" class="form-row form-row-first">
726 726
 			<label for="billing_country" class="give-label">
727
-				<?php esc_html_e( 'Country', 'give' ); ?>
728
-				<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { ?>
727
+				<?php esc_html_e('Country', 'give'); ?>
728
+				<?php if (give_field_is_required('billing_country', $form_id)) { ?>
729 729
 					<span class="give-required-indicator">*</span>
730 730
 				<?php } ?>
731
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>"></span>
731
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The country for your billing address.', 'give'); ?>"></span>
732 732
 			</label>
733 733
 
734
-			<select name="billing_country" id="billing_country" class="billing-country billing_country give-select<?php if ( give_field_is_required( 'billing_country', $form_id ) ) {
734
+			<select name="billing_country" id="billing_country" class="billing-country billing_country give-select<?php if (give_field_is_required('billing_country', $form_id)) {
735 735
 				echo ' required';
736
-			} ?>"<?php if ( give_field_is_required( 'billing_country', $form_id ) ) {
736
+			} ?>"<?php if (give_field_is_required('billing_country', $form_id)) {
737 737
 				echo ' required ';
738 738
 			} ?>>
739 739
 				<?php
740 740
 
741 741
 				$selected_country = give_get_country();
742 742
 
743
-				if ( $logged_in && ! empty( $user_address['country'] ) && '*' !== $user_address['country'] ) {
743
+				if ($logged_in && ! empty($user_address['country']) && '*' !== $user_address['country']) {
744 744
 					$selected_country = $user_address['country'];
745 745
 				}
746 746
 
747 747
 				$countries = give_get_country_list();
748
-				foreach ( $countries as $country_code => $country ) {
749
-					echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
748
+				foreach ($countries as $country_code => $country) {
749
+					echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
750 750
 				}
751 751
 				?>
752 752
 			</select>
@@ -754,44 +754,44 @@  discard block
 block discarded – undo
754 754
 
755 755
 		<p id="give-card-state-wrap" class="form-row form-row-last">
756 756
 			<label for="card_state" class="give-label">
757
-				<?php esc_html_e( 'State / Province', 'give' ); ?>
758
-				<?php if ( give_field_is_required( 'card_state', $form_id ) ) { ?>
757
+				<?php esc_html_e('State / Province', 'give'); ?>
758
+				<?php if (give_field_is_required('card_state', $form_id)) { ?>
759 759
 					<span class="give-required-indicator">*</span>
760 760
 				<?php } ?>
761
-				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The state or province for your billing address.', 'give' ); ?>"></span>
761
+				<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The state or province for your billing address.', 'give'); ?>"></span>
762 762
 			</label>
763 763
 
764 764
 			<?php
765 765
 			$selected_state = give_get_state();
766
-			$states         = give_get_states( $selected_country );
766
+			$states         = give_get_states($selected_country);
767 767
 
768
-			if ( $logged_in && ! empty( $user_address['state'] ) ) {
768
+			if ($logged_in && ! empty($user_address['state'])) {
769 769
 				$selected_state = $user_address['state'];
770 770
 			}
771 771
 
772
-			if ( ! empty( $states ) ) : ?>
773
-				<select name="card_state" id="card_state" class="card_state give-select<?php if ( give_field_is_required( 'card_state', $form_id ) ) {
772
+			if ( ! empty($states)) : ?>
773
+				<select name="card_state" id="card_state" class="card_state give-select<?php if (give_field_is_required('card_state', $form_id)) {
774 774
 					echo ' required';
775
-				} ?>"<?php if ( give_field_is_required( 'card_state', $form_id ) ) {
775
+				} ?>"<?php if (give_field_is_required('card_state', $form_id)) {
776 776
 					echo ' required ';
777 777
 				} ?>>
778 778
 					<?php
779
-					foreach ( $states as $state_code => $state ) {
780
-						echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
779
+					foreach ($states as $state_code => $state) {
780
+						echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
781 781
 					}
782 782
 					?>
783 783
 				</select>
784 784
 			<?php else : ?>
785
-				<input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php esc_attr_e( 'State / Province', 'give' ); ?>"/>
785
+				<input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php esc_attr_e('State / Province', 'give'); ?>"/>
786 786
 			<?php endif; ?>
787 787
 		</p>
788
-		<?php do_action( 'give_cc_billing_bottom' ); ?>
788
+		<?php do_action('give_cc_billing_bottom'); ?>
789 789
 	</fieldset>
790 790
 	<?php
791 791
 	echo ob_get_clean();
792 792
 }
793 793
 
794
-add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' );
794
+add_action('give_after_cc_fields', 'give_default_cc_address_fields');
795 795
 
796 796
 
797 797
 /**
@@ -803,93 +803,93 @@  discard block
 block discarded – undo
803 803
  *
804 804
  * @return string
805 805
  */
806
-function give_get_register_fields( $form_id ) {
806
+function give_get_register_fields($form_id) {
807 807
 
808 808
 	global $user_ID;
809 809
 
810
-	if ( is_user_logged_in() ) {
811
-		$user_data = get_userdata( $user_ID );
810
+	if (is_user_logged_in()) {
811
+		$user_data = get_userdata($user_ID);
812 812
 	}
813 813
 
814
-	$show_register_form = give_show_login_register_option( $form_id );
814
+	$show_register_form = give_show_login_register_option($form_id);
815 815
 
816 816
 	ob_start(); ?>
817 817
 	<fieldset id="give-register-fields-<?php echo $form_id; ?>">
818 818
 
819
-		<?php if ( $show_register_form == 'both' ) { ?>
819
+		<?php if ($show_register_form == 'both') { ?>
820 820
 			<div class="give-login-account-wrap">
821
-				<p class="give-login-message"><?php esc_html_e( 'Already have an account?', 'give' ); ?>&nbsp;
822
-					<a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-login" data-action="give_checkout_login"><?php esc_html_e( 'Login', 'give' ); ?></a>
821
+				<p class="give-login-message"><?php esc_html_e('Already have an account?', 'give'); ?>&nbsp;
822
+					<a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-login" data-action="give_checkout_login"><?php esc_html_e('Login', 'give'); ?></a>
823 823
 				</p>
824 824
 				<p class="give-loading-text">
825
-					<span class="give-loading-animation"></span> <?php esc_html_e( 'Loading...', 'give' ); ?></p>
825
+					<span class="give-loading-animation"></span> <?php esc_html_e('Loading...', 'give'); ?></p>
826 826
 			</div>
827 827
 		<?php } ?>
828 828
 
829
-		<?php do_action( 'give_register_fields_before', $form_id ); ?>
829
+		<?php do_action('give_register_fields_before', $form_id); ?>
830 830
 
831 831
 		<fieldset id="give-register-account-fields-<?php echo $form_id; ?>">
832
-			<legend><?php echo apply_filters( 'give_create_account_fieldset_heading', esc_html( 'Create an account', 'give' ) );
833
-				if ( ! give_logged_in_only( $form_id ) ) {
834
-					echo ' <span class="sub-text">' . esc_html( '(optional)', 'give' ) . '</span>';
832
+			<legend><?php echo apply_filters('give_create_account_fieldset_heading', esc_html('Create an account', 'give'));
833
+				if ( ! give_logged_in_only($form_id)) {
834
+					echo ' <span class="sub-text">'.esc_html('(optional)', 'give').'</span>';
835 835
 				} ?></legend>
836
-			<?php do_action( 'give_register_account_fields_before', $form_id ); ?>
836
+			<?php do_action('give_register_account_fields_before', $form_id); ?>
837 837
 			<div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third form-row-first">
838 838
 				<label for="give-user-login-<?php echo $form_id; ?>">
839
-					<?php esc_html_e( 'Username', 'give' ); ?>
840
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
839
+					<?php esc_html_e('Username', 'give'); ?>
840
+					<?php if (give_logged_in_only($form_id)) { ?>
841 841
 						<span class="give-required-indicator">*</span>
842 842
 					<?php } ?>
843
-					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The username you will use to log into your account.', 'give' ); ?>"></span>
843
+					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The username you will use to log into your account.', 'give'); ?>"></span>
844 844
 				</label>
845 845
 
846
-				<input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) {
846
+				<input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) {
847 847
 					echo 'required ';
848
-				} ?>give-input" type="text" placeholder="<?php esc_attr_e( 'Username', 'give' ); ?>" title="<?php esc_attr_e( 'Username', 'give' ); ?>"/>
848
+				} ?>give-input" type="text" placeholder="<?php esc_attr_e('Username', 'give'); ?>" title="<?php esc_attr_e('Username', 'give'); ?>"/>
849 849
 			</div>
850 850
 
851 851
 			<div id="give-user-pass-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third">
852 852
 				<label for="give-user-pass-<?php echo $form_id; ?>">
853
-					<?php esc_html_e( 'Password', 'give' ); ?>
854
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
853
+					<?php esc_html_e('Password', 'give'); ?>
854
+					<?php if (give_logged_in_only($form_id)) { ?>
855 855
 						<span class="give-required-indicator">*</span>
856 856
 					<?php } ?>
857
-					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'The password used to access your account.', 'give' ); ?>"></span>
857
+					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('The password used to access your account.', 'give'); ?>"></span>
858 858
 				</label>
859 859
 
860
-				<input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) {
860
+				<input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) {
861 861
 					echo 'required ';
862
-				} ?>give-input" placeholder="<?php esc_attr_e( 'Password', 'give' ); ?>" type="password"/>
862
+				} ?>give-input" placeholder="<?php esc_attr_e('Password', 'give'); ?>" type="password"/>
863 863
 			</div>
864 864
 
865 865
 			<div id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>" class="give-register-password form-row form-row-one-third">
866 866
 				<label for="give-user-pass-confirm-<?php echo $form_id; ?>">
867
-					<?php esc_html_e( 'Confirm PW', 'give' ); ?>
868
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
867
+					<?php esc_html_e('Confirm PW', 'give'); ?>
868
+					<?php if (give_logged_in_only($form_id)) { ?>
869 869
 						<span class="give-required-indicator">*</span>
870 870
 					<?php } ?>
871
-					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e( 'Please retype your password to confirm.', 'give' ); ?>"></span>
871
+					<span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php esc_attr_e('Please retype your password to confirm.', 'give'); ?>"></span>
872 872
 				</label>
873 873
 
874
-				<input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) {
874
+				<input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) {
875 875
 					echo 'required ';
876
-				} ?>give-input" placeholder="<?php esc_attr_e( 'Confirm password', 'give' ); ?>" type="password"/>
876
+				} ?>give-input" placeholder="<?php esc_attr_e('Confirm password', 'give'); ?>" type="password"/>
877 877
 			</div>
878
-			<?php do_action( 'give_register_account_fields_after', $form_id ); ?>
878
+			<?php do_action('give_register_account_fields_after', $form_id); ?>
879 879
 		</fieldset>
880 880
 
881
-		<?php do_action( 'give_register_fields_after', $form_id ); ?>
881
+		<?php do_action('give_register_fields_after', $form_id); ?>
882 882
 
883 883
 		<input type="hidden" name="give-purchase-var" value="needs-to-register"/>
884 884
 
885
-		<?php do_action( 'give_purchase_form_user_info', $form_id ); ?>
885
+		<?php do_action('give_purchase_form_user_info', $form_id); ?>
886 886
 
887 887
 	</fieldset>
888 888
 	<?php
889 889
 	echo ob_get_clean();
890 890
 }
891 891
 
892
-add_action( 'give_purchase_form_register_fields', 'give_get_register_fields' );
892
+add_action('give_purchase_form_register_fields', 'give_get_register_fields');
893 893
 
894 894
 /**
895 895
  * Gets the login fields for the login form on the checkout. This function hooks
@@ -902,79 +902,79 @@  discard block
 block discarded – undo
902 902
  *
903 903
  * @return string
904 904
  */
905
-function give_get_login_fields( $form_id ) {
905
+function give_get_login_fields($form_id) {
906 906
 
907
-	$form_id            = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id;
908
-	$show_register_form = give_show_login_register_option( $form_id );
907
+	$form_id            = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id;
908
+	$show_register_form = give_show_login_register_option($form_id);
909 909
 
910 910
 	ob_start();
911 911
 	?>
912 912
 	<fieldset id="give-login-fields-<?php echo $form_id; ?>">
913
-		<legend><?php echo apply_filters( 'give_account_login_fieldset_heading', esc_html( 'Login to Your Account', 'give' ) );
914
-			if ( ! give_logged_in_only( $form_id ) ) {
915
-				echo ' <span class="sub-text">' . esc_html( '(optional)', 'give' ) . '</span>';
913
+		<legend><?php echo apply_filters('give_account_login_fieldset_heading', esc_html('Login to Your Account', 'give'));
914
+			if ( ! give_logged_in_only($form_id)) {
915
+				echo ' <span class="sub-text">'.esc_html('(optional)', 'give').'</span>';
916 916
 			} ?>
917 917
 		</legend>
918
-		<?php if ( $show_register_form == 'both' ) { ?>
918
+		<?php if ($show_register_form == 'both') { ?>
919 919
 			<p class="give-new-account-link">
920
-				<?php esc_html_e( 'Need to create an account?', 'give' ); ?>&nbsp;
921
-				<a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-cancel" data-action="give_checkout_register">
922
-					<?php esc_html_e( 'Register', 'give' );
923
-					if ( ! give_logged_in_only( $form_id ) ) {
924
-						echo ' ' . esc_html( 'or checkout as a guest.', 'give' );
920
+				<?php esc_html_e('Need to create an account?', 'give'); ?>&nbsp;
921
+				<a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-cancel" data-action="give_checkout_register">
922
+					<?php esc_html_e('Register', 'give');
923
+					if ( ! give_logged_in_only($form_id)) {
924
+						echo ' '.esc_html('or checkout as a guest.', 'give');
925 925
 					} ?>
926 926
 				</a>
927 927
 			</p>
928 928
 			<p class="give-loading-text">
929
-				<span class="give-loading-animation"></span> <?php esc_html_e( 'Loading...', 'give' ); ?> </p>
929
+				<span class="give-loading-animation"></span> <?php esc_html_e('Loading...', 'give'); ?> </p>
930 930
 		<?php } ?>
931
-		<?php do_action( 'give_checkout_login_fields_before', $form_id ); ?>
931
+		<?php do_action('give_checkout_login_fields_before', $form_id); ?>
932 932
 		<div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first">
933 933
 			<label class="give-label" for="give-user-login-<?php echo $form_id; ?>">
934
-				<?php esc_html_e( 'Username', 'give' ); ?>
935
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
934
+				<?php esc_html_e('Username', 'give'); ?>
935
+				<?php if (give_logged_in_only($form_id)) { ?>
936 936
 					<span class="give-required-indicator">*</span>
937 937
 				<?php } ?>
938 938
 			</label>
939 939
 
940
-			<input class="<?php if ( give_logged_in_only( $form_id ) ) {
940
+			<input class="<?php if (give_logged_in_only($form_id)) {
941 941
 				echo 'required ';
942
-			} ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" placeholder="<?php esc_attr_e( 'Your username', 'give' ); ?>"/>
942
+			} ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" placeholder="<?php esc_attr_e('Your username', 'give'); ?>"/>
943 943
 		</div>
944 944
 
945 945
 		<div id="give-user-pass-wrap-<?php echo $form_id; ?>" class="give_login_password form-row form-row-last">
946 946
 			<label class="give-label" for="give-user-pass-<?php echo $form_id; ?>">
947
-				<?php esc_html_e( 'Password', 'give' ); ?>
948
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
947
+				<?php esc_html_e('Password', 'give'); ?>
948
+				<?php if (give_logged_in_only($form_id)) { ?>
949 949
 					<span class="give-required-indicator">*</span>
950 950
 				<?php } ?>
951 951
 			</label>
952
-			<input class="<?php if ( give_logged_in_only( $form_id ) ) {
952
+			<input class="<?php if (give_logged_in_only($form_id)) {
953 953
 				echo 'required ';
954
-			} ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" placeholder="<?php esc_attr_e( 'Your password', 'give' ); ?>"/>
954
+			} ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" placeholder="<?php esc_attr_e('Your password', 'give'); ?>"/>
955 955
 			<input type="hidden" name="give-purchase-var" value="needs-to-login"/>
956 956
 		</div>
957 957
 
958 958
 		<div id="give-forgot-password-wrap-<?php echo $form_id; ?>" class="give_login_forgot_password">
959 959
 			 <span class="give-forgot-password ">
960
-				 <a href="<?php echo wp_lostpassword_url( $redirect )?>"> <?php esc_html_e( 'Forgot password?' ) ?> </a>
960
+				 <a href="<?php echo wp_lostpassword_url($redirect)?>"> <?php esc_html_e('Forgot password?') ?> </a>
961 961
 			 </span>
962 962
 		</div>
963 963
 
964 964
 		<div id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix">
965
-			<input type="submit" class="give-submit give-btn button" name="give_login_submit" value="<?php esc_attr_e( 'Login', 'give' ); ?>"/>
966
-			<?php if ( $show_register_form !== 'login' ) { ?>
967
-				<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 esc_attr_e( 'Cancel', 'give' ); ?>"/>
965
+			<input type="submit" class="give-submit give-btn button" name="give_login_submit" value="<?php esc_attr_e('Login', 'give'); ?>"/>
966
+			<?php if ($show_register_form !== 'login') { ?>
967
+				<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 esc_attr_e('Cancel', 'give'); ?>"/>
968 968
 			<?php } ?>
969 969
 			<span class="give-loading-animation"></span>
970 970
 		</div>
971
-		<?php do_action( 'give_checkout_login_fields_after', $form_id ); ?>
971
+		<?php do_action('give_checkout_login_fields_after', $form_id); ?>
972 972
 	</fieldset><!--end #give-login-fields-->
973 973
 	<?php
974 974
 	echo ob_get_clean();
975 975
 }
976 976
 
977
-add_action( 'give_purchase_form_login_fields', 'give_get_login_fields', 10, 1 );
977
+add_action('give_purchase_form_login_fields', 'give_get_login_fields', 10, 1);
978 978
 
979 979
 /**
980 980
  * Payment Mode Select
@@ -990,49 +990,49 @@  discard block
 block discarded – undo
990 990
  *
991 991
  * @return void
992 992
  */
993
-function give_payment_mode_select( $form_id ) {
993
+function give_payment_mode_select($form_id) {
994 994
 
995 995
 	$gateways = give_get_enabled_payment_gateways();
996 996
 
997
-	do_action( 'give_payment_mode_top', $form_id ); ?>
997
+	do_action('give_payment_mode_top', $form_id); ?>
998 998
 
999 999
 	<fieldset id="give-payment-mode-select">
1000
-		<?php do_action( 'give_payment_mode_before_gateways_wrap' ); ?>
1000
+		<?php do_action('give_payment_mode_before_gateways_wrap'); ?>
1001 1001
 		<div id="give-payment-mode-wrap">
1002
-			<legend class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', esc_html( 'Select Payment Method', 'give' ) ); ?>
1003
-				<span class="give-loading-text"><span class="give-loading-animation"></span> <?php esc_html_e( 'Loading...', 'give' ); ?></span>
1002
+			<legend class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', esc_html('Select Payment Method', 'give')); ?>
1003
+				<span class="give-loading-text"><span class="give-loading-animation"></span> <?php esc_html_e('Loading...', 'give'); ?></span>
1004 1004
 			</legend>
1005 1005
 			<?php
1006 1006
 
1007
-			do_action( 'give_payment_mode_before_gateways' ) ?>
1007
+			do_action('give_payment_mode_before_gateways') ?>
1008 1008
 
1009 1009
 			<ul id="give-gateway-radio-list">
1010
-				<?php foreach ( $gateways as $gateway_id => $gateway ) :
1011
-					$checked       = checked( $gateway_id, give_get_default_gateway( $form_id ), false );
1010
+				<?php foreach ($gateways as $gateway_id => $gateway) :
1011
+					$checked       = checked($gateway_id, give_get_default_gateway($form_id), false);
1012 1012
 					$checked_class = $checked ? ' give-gateway-option-selected' : '';
1013
-					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 ) . '">';
1014
-					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'] );
1013
+					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).'">';
1014
+					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']);
1015 1015
 					echo '</label></li>';
1016 1016
 				endforeach; ?>
1017 1017
 			</ul>
1018
-			<?php do_action( 'give_payment_mode_after_gateways' ); ?>
1018
+			<?php do_action('give_payment_mode_after_gateways'); ?>
1019 1019
 		</div>
1020
-		<?php do_action( 'give_payment_mode_after_gateways_wrap' ); ?>
1020
+		<?php do_action('give_payment_mode_after_gateways_wrap'); ?>
1021 1021
 	</fieldset>
1022 1022
 
1023
-	<?php do_action( 'give_payment_mode_bottom', $form_id ); ?>
1023
+	<?php do_action('give_payment_mode_bottom', $form_id); ?>
1024 1024
 
1025 1025
 	<div id="give_purchase_form_wrap">
1026 1026
 
1027
-		<?php do_action( 'give_purchase_form', $form_id ); ?>
1027
+		<?php do_action('give_purchase_form', $form_id); ?>
1028 1028
 
1029 1029
 	</div><!-- the checkout fields are loaded into this-->
1030 1030
 
1031
-	<?php do_action( 'give_purchase_form_wrap_bottom', $form_id );
1031
+	<?php do_action('give_purchase_form_wrap_bottom', $form_id);
1032 1032
 
1033 1033
 }
1034 1034
 
1035
-add_action( 'give_payment_mode_select', 'give_payment_mode_select' );
1035
+add_action('give_payment_mode_select', 'give_payment_mode_select');
1036 1036
 
1037 1037
 
1038 1038
 /**
@@ -1047,36 +1047,36 @@  discard block
 block discarded – undo
1047 1047
  *
1048 1048
  * @return void
1049 1049
  */
1050
-function give_terms_agreement( $form_id ) {
1050
+function give_terms_agreement($form_id) {
1051 1051
 
1052
-	$form_option = get_post_meta( $form_id, '_give_terms_option', true );
1053
-	$label       = get_post_meta( $form_id, '_give_agree_label', true );
1054
-	$terms       = get_post_meta( $form_id, '_give_agree_text', true );
1052
+	$form_option = get_post_meta($form_id, '_give_terms_option', true);
1053
+	$label       = get_post_meta($form_id, '_give_agree_label', true);
1054
+	$terms       = get_post_meta($form_id, '_give_agree_text', true);
1055 1055
 
1056
-	if ( $form_option === 'yes' && ! empty( $terms ) ) { ?>
1056
+	if ($form_option === 'yes' && ! empty($terms)) { ?>
1057 1057
 		<fieldset id="give_terms_agreement">
1058
-			<div id="give_terms" class= "give_terms-<?php echo $form_id;?>" style="display:none;">
1058
+			<div id="give_terms" class= "give_terms-<?php echo $form_id; ?>" style="display:none;">
1059 1059
 				<?php
1060
-				do_action( 'give_before_terms' );
1061
-				echo wpautop( stripslashes( $terms ) );
1062
-				do_action( 'give_after_terms' );
1060
+				do_action('give_before_terms');
1061
+				echo wpautop(stripslashes($terms));
1062
+				do_action('give_after_terms');
1063 1063
 				?>
1064 1064
 			</div>
1065 1065
 			<div id="give_show_terms">
1066
-				<a href="#" class="give_terms_links give_terms_links-<?php echo $form_id;?>"><?php esc_html_e( 'Show Terms', 'give' ); ?></a>
1067
-				<a href="#" class="give_terms_links give_terms_links-<?php echo $form_id;?>" style="display:none;"><?php esc_html_e( 'Hide Terms', 'give' ); ?></a>
1066
+				<a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>"><?php esc_html_e('Show Terms', 'give'); ?></a>
1067
+				<a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" style="display:none;"><?php esc_html_e('Hide Terms', 'give'); ?></a>
1068 1068
 			</div>
1069 1069
 
1070 1070
 			<input name="give_agree_to_terms" class="required" type="checkbox" id="give_agree_to_terms" value="1"/>
1071 1071
 			<label
1072
-				for="give_agree_to_terms"><?php echo ! empty( $label ) ? stripslashes( $label ) : esc_html( 'Agree to Terms?', 'give' ); ?></label>
1072
+				for="give_agree_to_terms"><?php echo ! empty($label) ? stripslashes($label) : esc_html('Agree to Terms?', 'give'); ?></label>
1073 1073
 
1074 1074
 		</fieldset>
1075 1075
 		<?php
1076 1076
 	}
1077 1077
 }
1078 1078
 
1079
-add_action( 'give_purchase_form_before_submit', 'give_terms_agreement', 10, 1 );
1079
+add_action('give_purchase_form_before_submit', 'give_terms_agreement', 10, 1);
1080 1080
 
1081 1081
 /**
1082 1082
  * Checkout Final Total
@@ -1088,27 +1088,27 @@  discard block
 block discarded – undo
1088 1088
  * @since      1.0
1089 1089
  * @return void
1090 1090
  */
1091
-function give_checkout_final_total( $form_id ) {
1091
+function give_checkout_final_total($form_id) {
1092 1092
 
1093
-	if ( isset( $_POST['give_total'] ) ) {
1094
-		$total = apply_filters( 'give_donation_total', $_POST['give_total'] );
1093
+	if (isset($_POST['give_total'])) {
1094
+		$total = apply_filters('give_donation_total', $_POST['give_total']);
1095 1095
 	} else {
1096 1096
 		//default total
1097
-		$total = give_get_default_form_amount( $form_id );
1097
+		$total = give_get_default_form_amount($form_id);
1098 1098
 	}
1099 1099
 	//Only proceed if give_total available
1100
-	if ( empty( $total ) ) {
1100
+	if (empty($total)) {
1101 1101
 		return;
1102 1102
 	}
1103 1103
 	?>
1104 1104
 	<p id="give-final-total-wrap" class="form-wrap ">
1105
-		<span class="give-donation-total-label"><?php echo apply_filters( 'give_donation_total_label', esc_html( 'Donation Total:', 'give' ) ); ?></span>
1106
-		<span class="give-final-total-amount" data-total="<?php echo give_format_amount( $total ); ?>"><?php echo give_currency_filter( give_format_amount( $total ) ); ?></span>
1105
+		<span class="give-donation-total-label"><?php echo apply_filters('give_donation_total_label', esc_html('Donation Total:', 'give')); ?></span>
1106
+		<span class="give-final-total-amount" data-total="<?php echo give_format_amount($total); ?>"><?php echo give_currency_filter(give_format_amount($total)); ?></span>
1107 1107
 	</p>
1108 1108
 	<?php
1109 1109
 }
1110 1110
 
1111
-add_action( 'give_purchase_form_before_submit', 'give_checkout_final_total', 999 );
1111
+add_action('give_purchase_form_before_submit', 'give_checkout_final_total', 999);
1112 1112
 
1113 1113
 
1114 1114
 /**
@@ -1120,22 +1120,22 @@  discard block
 block discarded – undo
1120 1120
  *
1121 1121
  * @return void
1122 1122
  */
1123
-function give_checkout_submit( $form_id ) {
1123
+function give_checkout_submit($form_id) {
1124 1124
 	?>
1125 1125
 	<fieldset id="give_purchase_submit">
1126
-		<?php do_action( 'give_purchase_form_before_submit', $form_id ); ?>
1126
+		<?php do_action('give_purchase_form_before_submit', $form_id); ?>
1127 1127
 
1128
-		<?php give_checkout_hidden_fields( $form_id ); ?>
1128
+		<?php give_checkout_hidden_fields($form_id); ?>
1129 1129
 
1130
-		<?php echo give_checkout_button_purchase( $form_id ); ?>
1130
+		<?php echo give_checkout_button_purchase($form_id); ?>
1131 1131
 
1132
-		<?php do_action( 'give_purchase_form_after_submit', $form_id ); ?>
1132
+		<?php do_action('give_purchase_form_after_submit', $form_id); ?>
1133 1133
 
1134 1134
 	</fieldset>
1135 1135
 	<?php
1136 1136
 }
1137 1137
 
1138
-add_action( 'give_purchase_form_after_cc_form', 'give_checkout_submit', 9999 );
1138
+add_action('give_purchase_form_after_cc_form', 'give_checkout_submit', 9999);
1139 1139
 
1140 1140
 
1141 1141
 /**
@@ -1148,17 +1148,17 @@  discard block
 block discarded – undo
1148 1148
  *
1149 1149
  * @return string
1150 1150
  */
1151
-function give_checkout_button_purchase( $form_id ) {
1151
+function give_checkout_button_purchase($form_id) {
1152 1152
 
1153
-	$display_label_field = get_post_meta( $form_id, '_give_checkout_label', true );
1154
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : esc_html( 'Donate Now', 'give' ) );
1153
+	$display_label_field = get_post_meta($form_id, '_give_checkout_label', true);
1154
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : esc_html('Donate Now', 'give'));
1155 1155
 	ob_start(); ?>
1156 1156
 	<div class="give-submit-button-wrap give-clearfix">
1157 1157
 		<input type="submit" class="give-submit give-btn" id="give-purchase-button" name="give-purchase" value="<?php echo $display_label; ?>"/>
1158 1158
 		<span class="give-loading-animation"></span>
1159 1159
 	</div>
1160 1160
 	<?php
1161
-	return apply_filters( 'give_checkout_button_purchase', ob_get_clean(), $form_id );
1161
+	return apply_filters('give_checkout_button_purchase', ob_get_clean(), $form_id);
1162 1162
 }
1163 1163
 
1164 1164
 /**
@@ -1171,18 +1171,18 @@  discard block
 block discarded – undo
1171 1171
  *
1172 1172
  * @return void
1173 1173
  */
1174
-function give_agree_to_terms_js( $form_id ) {
1174
+function give_agree_to_terms_js($form_id) {
1175 1175
 
1176
-	$form_option = get_post_meta( $form_id, '_give_terms_option', true );
1176
+	$form_option = get_post_meta($form_id, '_give_terms_option', true);
1177 1177
 
1178
-	if ( $form_option === 'yes' ) {
1178
+	if ($form_option === 'yes') {
1179 1179
 		?>
1180 1180
 		<script type="text/javascript">
1181 1181
 			jQuery(document).ready(function ($) {
1182
-				$('body').on('click', '.give_terms_links-<?php echo $form_id;?>', function (e) {
1182
+				$('body').on('click', '.give_terms_links-<?php echo $form_id; ?>', function (e) {
1183 1183
 					e.preventDefault();
1184
-					$('.give_terms-<?php echo $form_id;?>').slideToggle();
1185
-					$('.give_terms_links-<?php echo $form_id;?>').toggle();
1184
+					$('.give_terms-<?php echo $form_id; ?>').slideToggle();
1185
+					$('.give_terms_links-<?php echo $form_id; ?>').toggle();
1186 1186
 					return false;
1187 1187
 				});
1188 1188
 			});
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 	}
1192 1192
 }
1193 1193
 
1194
-add_action( 'give_checkout_form_top', 'give_agree_to_terms_js', 10, 2 );
1194
+add_action('give_checkout_form_top', 'give_agree_to_terms_js', 10, 2);
1195 1195
 
1196 1196
 /**
1197 1197
  * Show Give Goals
@@ -1204,25 +1204,25 @@  discard block
 block discarded – undo
1204 1204
  * @return mixed
1205 1205
  */
1206 1206
 
1207
-function give_show_goal_progress( $form_id, $args ) {
1207
+function give_show_goal_progress($form_id, $args) {
1208 1208
 
1209
-	$goal_option = get_post_meta( $form_id, '_give_goal_option', true );
1210
-	$form        = new Give_Donate_Form( $form_id );
1209
+	$goal_option = get_post_meta($form_id, '_give_goal_option', true);
1210
+	$form        = new Give_Donate_Form($form_id);
1211 1211
 	$goal        = $form->goal;
1212
-	$goal_format = get_post_meta( $form_id, '_give_goal_format', true );
1212
+	$goal_format = get_post_meta($form_id, '_give_goal_format', true);
1213 1213
 	$income      = $form->get_earnings();
1214
-	$color       = get_post_meta( $form_id, '_give_goal_color', true );
1215
-	$show_text   = (bool) isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true;
1216
-	$show_bar    = (bool) isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true;
1214
+	$color       = get_post_meta($form_id, '_give_goal_color', true);
1215
+	$show_text   = (bool) isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true;
1216
+	$show_bar    = (bool) isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true;
1217 1217
 
1218 1218
 	//Sanity check - respect shortcode args
1219
-	if ( isset( $args['show_goal'] ) && $args['show_goal'] === false ) {
1219
+	if (isset($args['show_goal']) && $args['show_goal'] === false) {
1220 1220
 		return false;
1221 1221
 	}
1222 1222
 
1223 1223
 	//Sanity check - ensure form has goal set to output
1224
-	if ( empty( $form->ID )
1225
-	     || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' )
1224
+	if (empty($form->ID)
1225
+	     || (is_singular('give_forms') && $goal_option !== 'yes')
1226 1226
 	     || $goal_option !== 'yes'
1227 1227
 	     || $goal == 0
1228 1228
 	) {
@@ -1230,34 +1230,34 @@  discard block
 block discarded – undo
1230 1230
 		return false;
1231 1231
 	}
1232 1232
 
1233
-	$progress = round( ( $income / $goal ) * 100, 2 );
1233
+	$progress = round(($income / $goal) * 100, 2);
1234 1234
 
1235
-	if ( $income >= $goal ) {
1235
+	if ($income >= $goal) {
1236 1236
 		$progress = 100;
1237 1237
 	}
1238 1238
 
1239 1239
 	$output = '<div class="give-goal-progress">';
1240 1240
 
1241 1241
 	//Goal Progress Text
1242
-	if ( ! empty( $show_text ) ) {
1242
+	if ( ! empty($show_text)) {
1243 1243
 
1244 1244
 		$output .= '<div class="raised">';
1245 1245
 
1246
-		if ( $goal_format !== 'percentage' ) {
1246
+		if ($goal_format !== 'percentage') {
1247 1247
 
1248 1248
 			$output .= sprintf(
1249 1249
 				/* translators: 1: amount of income raised 2: goal target ammount */
1250
-				esc_html( '%1$s of %2$s raised', 'give' ),
1251
-				'<span class="income">' . apply_filters( 'give_goal_amount_raised_output', give_currency_filter( give_format_amount( $income ) ) ) . '</span>',
1252
-				'<span class="goal-text">' . apply_filters( 'give_goal_amount_target_output', give_currency_filter( give_format_amount( $goal ) ) ) . '</span>'
1250
+				esc_html('%1$s of %2$s raised', 'give'),
1251
+				'<span class="income">'.apply_filters('give_goal_amount_raised_output', give_currency_filter(give_format_amount($income))).'</span>',
1252
+				'<span class="goal-text">'.apply_filters('give_goal_amount_target_output', give_currency_filter(give_format_amount($goal))).'</span>'
1253 1253
 			);
1254 1254
 
1255
-		} elseif ( $goal_format == 'percentage' ) {
1255
+		} elseif ($goal_format == 'percentage') {
1256 1256
 
1257 1257
 			$output .= sprintf(
1258 1258
 				/* translators: %s: percentage of the amount raised compared to the goal target */
1259
-				esc_html( '%s%% funded', 'give' ),
1260
-				'<span class="give-percentage">' . apply_filters( 'give_goal_amount_funded_percentage_output', round( $progress ) ) . '</span>'
1259
+				esc_html('%s%% funded', 'give'),
1260
+				'<span class="give-percentage">'.apply_filters('give_goal_amount_funded_percentage_output', round($progress)).'</span>'
1261 1261
 			);
1262 1262
 
1263 1263
 		}
@@ -1267,11 +1267,11 @@  discard block
 block discarded – undo
1267 1267
 	}
1268 1268
 
1269 1269
 	//Goal Progress Bar
1270
-	if ( ! empty( $show_bar ) ) {
1270
+	if ( ! empty($show_bar)) {
1271 1271
 		$output .= '<div class="give-progress-bar">';
1272
-		$output .= '<span style="width: ' . esc_attr( $progress ) . '%;';
1273
-		if ( ! empty( $color ) ) {
1274
-			$output .= 'background-color:' . $color;
1272
+		$output .= '<span style="width: '.esc_attr($progress).'%;';
1273
+		if ( ! empty($color)) {
1274
+			$output .= 'background-color:'.$color;
1275 1275
 		}
1276 1276
 		$output .= '"></span>';
1277 1277
 		$output .= '</div><!-- /.give-progress-bar -->';
@@ -1279,13 +1279,13 @@  discard block
 block discarded – undo
1279 1279
 
1280 1280
 	$output .= '</div><!-- /.goal-progress -->';
1281 1281
 
1282
-	echo apply_filters( 'give_goal_output', $output );
1282
+	echo apply_filters('give_goal_output', $output);
1283 1283
 
1284 1284
 	return false;
1285 1285
 
1286 1286
 }
1287 1287
 
1288
-add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 );
1288
+add_action('give_pre_form', 'give_show_goal_progress', 10, 2);
1289 1289
 
1290 1290
 /**
1291 1291
  * Adds Actions to Render Form Content
@@ -1297,19 +1297,19 @@  discard block
 block discarded – undo
1297 1297
  *
1298 1298
  * @return void
1299 1299
  */
1300
-function give_form_content( $form_id, $args ) {
1300
+function give_form_content($form_id, $args) {
1301 1301
 
1302
-	$show_content = ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) )
1302
+	$show_content = (isset($args['show_content']) && ! empty($args['show_content']))
1303 1303
 		? $args['show_content']
1304
-		: get_post_meta( $form_id, '_give_content_option', true );
1304
+		: get_post_meta($form_id, '_give_content_option', true);
1305 1305
 
1306
-	if ( $show_content !== 'none' ) {
1306
+	if ($show_content !== 'none') {
1307 1307
 		//add action according to value
1308
-		add_action( $show_content, 'give_form_display_content', 10, 2 );
1308
+		add_action($show_content, 'give_form_display_content', 10, 2);
1309 1309
 	}
1310 1310
 }
1311 1311
 
1312
-add_action( 'give_pre_form_output', 'give_form_content', 10, 2 );
1312
+add_action('give_pre_form_output', 'give_form_content', 10, 2);
1313 1313
 
1314 1314
 /**
1315 1315
  * Renders Post Form Content
@@ -1321,24 +1321,24 @@  discard block
 block discarded – undo
1321 1321
  * @return void
1322 1322
  * @since      1.0
1323 1323
  */
1324
-function give_form_display_content( $form_id, $args ) {
1324
+function give_form_display_content($form_id, $args) {
1325 1325
 
1326
-	$content      = wpautop( get_post_meta( $form_id, '_give_form_content', true ) );
1327
-	$show_content = ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) )
1326
+	$content      = wpautop(get_post_meta($form_id, '_give_form_content', true));
1327
+	$show_content = (isset($args['show_content']) && ! empty($args['show_content']))
1328 1328
 		? $args['show_content']
1329
-		: get_post_meta( $form_id, '_give_content_option', true );
1329
+		: get_post_meta($form_id, '_give_content_option', true);
1330 1330
 
1331
-	if ( give_get_option( 'disable_the_content_filter' ) !== 'on' ) {
1332
-		$content = apply_filters( 'the_content', $content );
1331
+	if (give_get_option('disable_the_content_filter') !== 'on') {
1332
+		$content = apply_filters('the_content', $content);
1333 1333
 	}
1334 1334
 
1335
-	$output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap" >' . $content . '</div>';
1335
+	$output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap" >'.$content.'</div>';
1336 1336
 
1337
-	echo apply_filters( 'give_form_content_output', $output );
1337
+	echo apply_filters('give_form_content_output', $output);
1338 1338
 
1339 1339
 	//remove action to prevent content output on addition forms on page
1340 1340
 	//@see: https://github.com/WordImpress/Give/issues/634
1341
-	remove_action( $show_content, 'give_form_display_content' );
1341
+	remove_action($show_content, 'give_form_display_content');
1342 1342
 }
1343 1343
 
1344 1344
 
@@ -1351,16 +1351,16 @@  discard block
 block discarded – undo
1351 1351
  *
1352 1352
  * @return void
1353 1353
  */
1354
-function give_checkout_hidden_fields( $form_id ) {
1354
+function give_checkout_hidden_fields($form_id) {
1355 1355
 
1356
-	do_action( 'give_hidden_fields_before', $form_id );
1357
-	if ( is_user_logged_in() ) { ?>
1356
+	do_action('give_hidden_fields_before', $form_id);
1357
+	if (is_user_logged_in()) { ?>
1358 1358
 		<input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/>
1359 1359
 	<?php } ?>
1360 1360
 	<input type="hidden" name="give_action" value="purchase"/>
1361
-	<input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/>
1361
+	<input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/>
1362 1362
 	<?php
1363
-	do_action( 'give_hidden_fields_after', $form_id );
1363
+	do_action('give_hidden_fields_after', $form_id);
1364 1364
 
1365 1365
 }
1366 1366
 
@@ -1375,20 +1375,20 @@  discard block
 block discarded – undo
1375 1375
  *
1376 1376
  * @return string $content Filtered content
1377 1377
  */
1378
-function give_filter_success_page_content( $content ) {
1378
+function give_filter_success_page_content($content) {
1379 1379
 
1380 1380
 	global $give_options;
1381 1381
 
1382
-	if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) {
1383
-		if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) {
1384
-			$content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content );
1382
+	if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) {
1383
+		if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) {
1384
+			$content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content);
1385 1385
 		}
1386 1386
 	}
1387 1387
 
1388 1388
 	return $content;
1389 1389
 }
1390 1390
 
1391
-add_filter( 'the_content', 'give_filter_success_page_content' );
1391
+add_filter('the_content', 'give_filter_success_page_content');
1392 1392
 
1393 1393
 
1394 1394
 /**
@@ -1400,14 +1400,14 @@  discard block
 block discarded – undo
1400 1400
 
1401 1401
 function give_test_mode_frontend_warning() {
1402 1402
 
1403
-	$test_mode = give_get_option( 'test_mode' );
1403
+	$test_mode = give_get_option('test_mode');
1404 1404
 
1405
-	if ( $test_mode == 'on' ) {
1406
-		echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>' . esc_html( 'Notice', 'give' ) . '</strong>: ' . esc_html( 'Test mode is enabled. While in test mode no live transactions are processed.', 'give' ) . '</p></div>';
1405
+	if ($test_mode == 'on') {
1406
+		echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>'.esc_html('Notice', 'give').'</strong>: '.esc_html('Test mode is enabled. While in test mode no live transactions are processed.', 'give').'</p></div>';
1407 1407
 	}
1408 1408
 }
1409 1409
 
1410
-add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 );
1410
+add_action('give_pre_form', 'give_test_mode_frontend_warning', 10);
1411 1411
 
1412 1412
 
1413 1413
 /**
@@ -1417,21 +1417,21 @@  discard block
 block discarded – undo
1417 1417
  * @since       1.4.1
1418 1418
  */
1419 1419
 
1420
-function give_members_only_form( $final_output, $args ) {
1420
+function give_members_only_form($final_output, $args) {
1421 1421
 
1422
-	$form_id = isset( $args['form_id'] ) ? $args['form_id'] : 0;
1422
+	$form_id = isset($args['form_id']) ? $args['form_id'] : 0;
1423 1423
 
1424 1424
 	//Sanity Check: Must have form_id & not be logged in
1425
-	if ( empty( $form_id ) || is_user_logged_in() ) {
1425
+	if (empty($form_id) || is_user_logged_in()) {
1426 1426
 		return $final_output;
1427 1427
 	}
1428 1428
 
1429 1429
 	//Logged in only and Register / Login set to none
1430
-	if ( give_logged_in_only( $form_id ) && give_show_login_register_option( $form_id ) == 'none' ) {
1430
+	if (give_logged_in_only($form_id) && give_show_login_register_option($form_id) == 'none') {
1431 1431
 
1432
-		$final_output = give_output_error( esc_html( 'Please login in order to complete your donation.', 'give' ), false );
1432
+		$final_output = give_output_error(esc_html('Please login in order to complete your donation.', 'give'), false);
1433 1433
 
1434
-		return apply_filters( 'give_members_only_output', $final_output, $form_id );
1434
+		return apply_filters('give_members_only_output', $final_output, $form_id);
1435 1435
 
1436 1436
 	}
1437 1437
 
@@ -1439,4 +1439,4 @@  discard block
 block discarded – undo
1439 1439
 
1440 1440
 }
1441 1441
 
1442
-add_filter( 'give_donate_form', 'give_members_only_form', 10, 2 );
1442
+add_filter('give_donate_form', 'give_members_only_form', 10, 2);
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -781,8 +781,11 @@
 block discarded – undo
781 781
 					}
782 782
 					?>
783 783
 				</select>
784
-			<?php else : ?>
785
-				<input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php esc_attr_e( 'State / Province', 'give' ); ?>"/>
784
+			<?php else {
785
+	: ?>
786
+				<input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php esc_attr_e( 'State / Province', 'give' );
787
+}
788
+?>"/>
786 789
 			<?php endif; ?>
787 790
 		</p>
788 791
 		<?php do_action( 'give_cc_billing_bottom' ); ?>
Please login to merge, or discard this patch.
includes/process-purchase.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * @access      private
23 23
  * @since       1.0
24
- * @return      void
24
+ * @return      false|null
25 25
  */
26 26
 function give_process_purchase_form() {
27 27
 
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
  *
327 327
  * @since  1.0.1
328 328
  *
329
- * @param $payment_mode
329
+ * @param string $payment_mode
330 330
  *
331 331
  * @return mixed|void
332 332
  */
Please login to merge, or discard this patch.
Spacing   +234 added lines, -234 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
 
@@ -25,27 +25,27 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function give_process_purchase_form() {
27 27
 
28
-	do_action( 'give_pre_process_purchase' );
28
+	do_action('give_pre_process_purchase');
29 29
 
30 30
 	// Validate the form $_POST data
31 31
 	$valid_data = give_purchase_form_validate_fields();
32 32
 
33 33
 	// Allow themes and plugins to hook to errors
34
-	do_action( 'give_checkout_error_checks', $valid_data, $_POST );
34
+	do_action('give_checkout_error_checks', $valid_data, $_POST);
35 35
 
36
-	$is_ajax = isset( $_POST['give_ajax'] );
36
+	$is_ajax = isset($_POST['give_ajax']);
37 37
 
38 38
 	// Process the login form
39
-	if ( isset( $_POST['give_login_submit'] ) ) {
39
+	if (isset($_POST['give_login_submit'])) {
40 40
 		give_process_form_login();
41 41
 	}
42 42
 
43 43
 	// Validate the user
44
-	$user = give_get_purchase_form_user( $valid_data );
44
+	$user = give_get_purchase_form_user($valid_data);
45 45
 
46
-	if ( false === $valid_data || give_get_errors() || ! $user ) {
47
-		if ( $is_ajax ) {
48
-			do_action( 'give_ajax_checkout_errors' );
46
+	if (false === $valid_data || give_get_errors() || ! $user) {
47
+		if ($is_ajax) {
48
+			do_action('give_ajax_checkout_errors');
49 49
 			give_die();
50 50
 		} else {
51 51
 			return false;
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 	}
54 54
 
55 55
 	//If AJAX send back success to proceed with form submission
56
-	if ( $is_ajax ) {
56
+	if ($is_ajax) {
57 57
 		echo 'success';
58 58
 		give_die();
59 59
 	}
60 60
 
61 61
 	//After AJAX: Setup session if not using php_sessions
62
-	if ( ! Give()->session->use_php_sessions() ) {
62
+	if ( ! Give()->session->use_php_sessions()) {
63 63
 		//Double-check that set_cookie is publicly accessible;
64 64
 		// we're using a slightly modified class-wp-sessions.php
65
-		$session_reflection = new ReflectionMethod( 'WP_Session', 'set_cookie' );
66
-		if ( $session_reflection->isPublic() ) {
65
+		$session_reflection = new ReflectionMethod('WP_Session', 'set_cookie');
66
+		if ($session_reflection->isPublic()) {
67 67
 			// Manually set the cookie.
68 68
 			Give()->session->init()->set_cookie();
69 69
 		}
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
 		'address'    => $user['address']
79 79
 	);
80 80
 
81
-	$auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : '';
81
+	$auth_key = defined('AUTH_KEY') ? AUTH_KEY : '';
82 82
 
83
-	$price        = isset( $_POST['give-amount'] ) ? (float) apply_filters( 'give_donation_total', give_sanitize_amount( give_format_amount( $_POST['give-amount'] ) ) ) : '0.00';
84
-	$purchase_key = strtolower( md5( $user['user_email'] . date( 'Y-m-d H:i:s' ) . $auth_key . uniqid( 'give', true ) ) );
83
+	$price        = isset($_POST['give-amount']) ? (float) apply_filters('give_donation_total', give_sanitize_amount(give_format_amount($_POST['give-amount']))) : '0.00';
84
+	$purchase_key = strtolower(md5($user['user_email'].date('Y-m-d H:i:s').$auth_key.uniqid('give', true)));
85 85
 
86 86
 	// Setup purchase information
87 87
 	$purchase_data = array(
88 88
 		'price'        => $price,
89 89
 		'purchase_key' => $purchase_key,
90 90
 		'user_email'   => $user['user_email'],
91
-		'date'         => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
92
-		'user_info'    => stripslashes_deep( $user_info ),
91
+		'date'         => date('Y-m-d H:i:s', current_time('timestamp')),
92
+		'user_info'    => stripslashes_deep($user_info),
93 93
 		'post_data'    => $_POST,
94 94
 		'gateway'      => $valid_data['gateway'],
95 95
 		'card_info'    => $valid_data['cc_info']
@@ -99,37 +99,37 @@  discard block
 block discarded – undo
99 99
 	$valid_data['user'] = $user;
100 100
 
101 101
 	// Allow themes and plugins to hook before the gateway
102
-	do_action( 'give_checkout_before_gateway', $_POST, $user_info, $valid_data );
102
+	do_action('give_checkout_before_gateway', $_POST, $user_info, $valid_data);
103 103
 
104 104
 	//Sanity check for price
105
-	if ( ! $purchase_data['price'] ) {
105
+	if ( ! $purchase_data['price']) {
106 106
 		// Revert to manual
107 107
 		$purchase_data['gateway'] = 'manual';
108 108
 		$_POST['give-gateway']    = 'manual';
109 109
 	}
110 110
 
111 111
 	// Allow the purchase data to be modified before it is sent to the gateway
112
-	$purchase_data = apply_filters( 'give_purchase_data_before_gateway', $purchase_data, $valid_data );
112
+	$purchase_data = apply_filters('give_purchase_data_before_gateway', $purchase_data, $valid_data);
113 113
 
114 114
 	// Setup the data we're storing in the purchase session
115 115
 	$session_data = $purchase_data;
116 116
 
117 117
 	// Make sure credit card numbers are never stored in sessions
118
-	unset( $session_data['card_info']['card_number'] );
119
-	unset( $session_data['post_data']['card_number'] );
118
+	unset($session_data['card_info']['card_number']);
119
+	unset($session_data['post_data']['card_number']);
120 120
 
121 121
 	// Used for showing data to non logged-in users after purchase, and for other plugins needing purchase data.
122
-	give_set_purchase_session( $session_data );
122
+	give_set_purchase_session($session_data);
123 123
 
124 124
 	// Send info to the gateway for payment processing
125
-	give_send_to_gateway( $purchase_data['gateway'], $purchase_data );
125
+	give_send_to_gateway($purchase_data['gateway'], $purchase_data);
126 126
 	give_die();
127 127
 
128 128
 }
129 129
 
130
-add_action( 'give_purchase', 'give_process_purchase_form' );
131
-add_action( 'wp_ajax_give_process_checkout', 'give_process_purchase_form' );
132
-add_action( 'wp_ajax_nopriv_give_process_checkout', 'give_process_purchase_form' );
130
+add_action('give_purchase', 'give_process_purchase_form');
131
+add_action('wp_ajax_give_process_checkout', 'give_process_purchase_form');
132
+add_action('wp_ajax_nopriv_give_process_checkout', 'give_process_purchase_form');
133 133
 
134 134
 /**
135 135
  * Process the checkout login form
@@ -140,32 +140,32 @@  discard block
 block discarded – undo
140 140
  */
141 141
 function give_process_form_login() {
142 142
 
143
-	$is_ajax = isset( $_POST['give_ajax'] );
143
+	$is_ajax = isset($_POST['give_ajax']);
144 144
 
145 145
 	$user_data = give_purchase_form_validate_user_login();
146 146
 
147
-	if ( give_get_errors() || $user_data['user_id'] < 1 ) {
148
-		if ( $is_ajax ) {
149
-			do_action( 'give_ajax_checkout_errors' );
147
+	if (give_get_errors() || $user_data['user_id'] < 1) {
148
+		if ($is_ajax) {
149
+			do_action('give_ajax_checkout_errors');
150 150
 			give_die();
151 151
 		} else {
152
-			wp_redirect( $_SERVER['HTTP_REFERER'] );
152
+			wp_redirect($_SERVER['HTTP_REFERER']);
153 153
 			exit;
154 154
 		}
155 155
 	}
156 156
 
157
-	give_log_user_in( $user_data['user_id'], $user_data['user_login'], $user_data['user_pass'] );
157
+	give_log_user_in($user_data['user_id'], $user_data['user_login'], $user_data['user_pass']);
158 158
 
159
-	if ( $is_ajax ) {
159
+	if ($is_ajax) {
160 160
 		echo 'success';
161 161
 		give_die();
162 162
 	} else {
163
-		wp_redirect( $_SERVER['HTTP_REFERER'] );
163
+		wp_redirect($_SERVER['HTTP_REFERER']);
164 164
 	}
165 165
 }
166 166
 
167
-add_action( 'wp_ajax_give_process_checkout_login', 'give_process_form_login' );
168
-add_action( 'wp_ajax_nopriv_give_process_checkout_login', 'give_process_form_login' );
167
+add_action('wp_ajax_give_process_checkout_login', 'give_process_form_login');
168
+add_action('wp_ajax_nopriv_give_process_checkout_login', 'give_process_form_login');
169 169
 
170 170
 /**
171 171
  * Purchase Form Validate Fields
@@ -177,45 +177,45 @@  discard block
 block discarded – undo
177 177
 function give_purchase_form_validate_fields() {
178 178
 
179 179
 	// Check if there is $_POST
180
-	if ( empty( $_POST ) ) {
180
+	if (empty($_POST)) {
181 181
 		return false;
182 182
 	}
183 183
 
184
-	$form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : '';
184
+	$form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : '';
185 185
 
186 186
 	// Start an array to collect valid data
187 187
 	$valid_data = array(
188 188
 		'gateway'          => give_purchase_form_validate_gateway(), // Gateway fallback (amount is validated here)
189
-		'need_new_user'    => false,     // New user flag
190
-		'need_user_login'  => false,     // Login user flag
191
-		'logged_user_data' => array(),   // Logged user collected data
192
-		'new_user_data'    => array(),   // New user collected data
193
-		'login_user_data'  => array(),   // Login user collected data
194
-		'guest_user_data'  => array(),   // Guest user collected data
189
+		'need_new_user'    => false, // New user flag
190
+		'need_user_login'  => false, // Login user flag
191
+		'logged_user_data' => array(), // Logged user collected data
192
+		'new_user_data'    => array(), // New user collected data
193
+		'login_user_data'  => array(), // Login user collected data
194
+		'guest_user_data'  => array(), // Guest user collected data
195 195
 		'cc_info'          => give_purchase_form_validate_cc()    // Credit card info
196 196
 	);
197 197
 
198 198
 	//Validate Honeypot First
199
-	if ( ! empty( $_POST['give-honeypot'] ) ) {
200
-		give_set_error( 'invalid_honeypot', esc_html( 'Honeypot field detected. Go away bad bot!', 'give' ) );
199
+	if ( ! empty($_POST['give-honeypot'])) {
200
+		give_set_error('invalid_honeypot', esc_html('Honeypot field detected. Go away bad bot!', 'give'));
201 201
 	}
202 202
 
203 203
 	// Validate agree to terms
204
-	$terms_option = get_post_meta( $form_id, '_give_terms_option', true );
205
-	if ( isset( $terms_option ) && $terms_option === 'yes' ) {
204
+	$terms_option = get_post_meta($form_id, '_give_terms_option', true);
205
+	if (isset($terms_option) && $terms_option === 'yes') {
206 206
 		give_purchase_form_validate_agree_to_terms();
207 207
 	}
208 208
 
209
-	if ( is_user_logged_in() ) {
209
+	if (is_user_logged_in()) {
210 210
 		// Collect logged in user data
211 211
 		$valid_data['logged_in_user'] = give_purchase_form_validate_logged_in_user();
212
-	} else if ( isset( $_POST['give-purchase-var'] ) && $_POST['give-purchase-var'] == 'needs-to-register' ) {
212
+	} else if (isset($_POST['give-purchase-var']) && $_POST['give-purchase-var'] == 'needs-to-register') {
213 213
 		// Set new user registration as required
214 214
 		$valid_data['need_new_user'] = true;
215 215
 		// Validate new user data
216 216
 		$valid_data['new_user_data'] = give_purchase_form_validate_new_user();
217 217
 		// Check if login validation is needed
218
-	} else if ( isset( $_POST['give-purchase-var'] ) && $_POST['give-purchase-var'] == 'needs-to-login' ) {
218
+	} else if (isset($_POST['give-purchase-var']) && $_POST['give-purchase-var'] == 'needs-to-login') {
219 219
 		// Set user login as required
220 220
 		$valid_data['need_user_login'] = true;
221 221
 		// Validate users login info
@@ -240,41 +240,41 @@  discard block
 block discarded – undo
240 240
  */
241 241
 function give_purchase_form_validate_gateway() {
242 242
 
243
-	$form_id = isset( $_REQUEST['give-form-id'] ) ? $_REQUEST['give-form-id'] : 0;
244
-	$amount  = isset( $_REQUEST['give-amount'] ) ? give_sanitize_amount( $_REQUEST['give-amount'] ) : 0;
245
-	$gateway = give_get_default_gateway( $form_id );
243
+	$form_id = isset($_REQUEST['give-form-id']) ? $_REQUEST['give-form-id'] : 0;
244
+	$amount  = isset($_REQUEST['give-amount']) ? give_sanitize_amount($_REQUEST['give-amount']) : 0;
245
+	$gateway = give_get_default_gateway($form_id);
246 246
 
247 247
 	// Check if a gateway value is present
248
-	if ( ! empty( $_REQUEST['give-gateway'] ) ) {
248
+	if ( ! empty($_REQUEST['give-gateway'])) {
249 249
 
250
-		$gateway = sanitize_text_field( $_REQUEST['give-gateway'] );
250
+		$gateway = sanitize_text_field($_REQUEST['give-gateway']);
251 251
 
252 252
 		//Is amount being donated in LIVE mode 0.00? If so, error:
253
-		if ( $amount == 0 && ! give_is_test_mode() ) {
253
+		if ($amount == 0 && ! give_is_test_mode()) {
254 254
 
255
-			give_set_error( 'invalid_donation_amount', esc_html( 'Please insert a valid donation amount.', 'give' ) );
255
+			give_set_error('invalid_donation_amount', esc_html('Please insert a valid donation amount.', 'give'));
256 256
 
257 257
 		} //Check for a minimum custom amount
258
-		elseif ( ! give_verify_minimum_price() ) {
258
+		elseif ( ! give_verify_minimum_price()) {
259 259
 
260 260
 			give_set_error(
261 261
 				'invalid_donation_minimum',
262 262
 				sprintf(
263 263
 					/* translators: %s: minimum donation amount */
264
-					esc_html( 'This form has a minimum donation amount of %s.', 'give' ),
265
-					give_currency_filter( give_format_amount( give_get_form_minimum_price( $form_id ) ) )
264
+					esc_html('This form has a minimum donation amount of %s.', 'give'),
265
+					give_currency_filter(give_format_amount(give_get_form_minimum_price($form_id)))
266 266
 				)
267 267
 			);
268 268
 
269 269
 		} //Is this test mode zero donation? Let it through but set to manual gateway
270
-		elseif ( $amount == 0 && give_is_test_mode() ) {
270
+		elseif ($amount == 0 && give_is_test_mode()) {
271 271
 
272 272
 			$gateway = 'manual';
273 273
 
274 274
 		} //Check if this gateway is active
275
-		elseif ( ! give_is_gateway_active( $gateway ) ) {
275
+		elseif ( ! give_is_gateway_active($gateway)) {
276 276
 
277
-			give_set_error( 'invalid_gateway', esc_html( 'The selected payment gateway is not enabled.', 'give' ) );
277
+			give_set_error('invalid_gateway', esc_html('The selected payment gateway is not enabled.', 'give'));
278 278
 
279 279
 		}
280 280
 
@@ -293,23 +293,23 @@  discard block
 block discarded – undo
293 293
  */
294 294
 function give_verify_minimum_price() {
295 295
 
296
-	$amount          = give_sanitize_amount( $_REQUEST['give-amount'] );
297
-	$form_id         = isset( $_REQUEST['give-form-id'] ) ? $_REQUEST['give-form-id'] : 0;
298
-	$price_id        = isset( $_REQUEST['give-price-id'] ) ? $_REQUEST['give-price-id'] : 0;
299
-	$variable_prices = give_has_variable_prices( $form_id );
296
+	$amount          = give_sanitize_amount($_REQUEST['give-amount']);
297
+	$form_id         = isset($_REQUEST['give-form-id']) ? $_REQUEST['give-form-id'] : 0;
298
+	$price_id        = isset($_REQUEST['give-price-id']) ? $_REQUEST['give-price-id'] : 0;
299
+	$variable_prices = give_has_variable_prices($form_id);
300 300
 
301
-	if ( $variable_prices && ! empty( $price_id ) ) {
301
+	if ($variable_prices && ! empty($price_id)) {
302 302
 
303
-		$price_level_amount = give_get_price_option_amount( $form_id, $price_id );
303
+		$price_level_amount = give_get_price_option_amount($form_id, $price_id);
304 304
 
305
-		if ( $price_level_amount == $amount ) {
305
+		if ($price_level_amount == $amount) {
306 306
 			return true;
307 307
 		}
308 308
 	}
309 309
 
310
-	$minimum = give_get_form_minimum_price( $form_id );
310
+	$minimum = give_get_form_minimum_price($form_id);
311 311
 
312
-	if ( $minimum > $amount ) {
312
+	if ($minimum > $amount) {
313 313
 		return false;
314 314
 	}
315 315
 
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
  */
326 326
 function give_purchase_form_validate_agree_to_terms() {
327 327
 	// Validate agree to terms
328
-	if ( ! isset( $_POST['give_agree_to_terms'] ) || $_POST['give_agree_to_terms'] != 1 ) {
328
+	if ( ! isset($_POST['give_agree_to_terms']) || $_POST['give_agree_to_terms'] != 1) {
329 329
 		// User did not agree
330
-		give_set_error( 'agree_to_terms', apply_filters( 'give_agree_to_terms_text', esc_html( 'You must agree to the terms of use.', 'give' ) ) );
330
+		give_set_error('agree_to_terms', apply_filters('give_agree_to_terms_text', esc_html('You must agree to the terms of use.', 'give')));
331 331
 	}
332 332
 }
333 333
 
@@ -341,47 +341,47 @@  discard block
 block discarded – undo
341 341
  *
342 342
  * @return      array
343 343
  */
344
-function give_purchase_form_required_fields( $form_id ) {
344
+function give_purchase_form_required_fields($form_id) {
345 345
 
346
-	$payment_mode = give_get_chosen_gateway( $form_id );
346
+	$payment_mode = give_get_chosen_gateway($form_id);
347 347
 
348 348
 	$required_fields = array(
349 349
 		'give_email' => array(
350 350
 			'error_id'      => 'invalid_email',
351
-			'error_message' => esc_html( 'Please enter a valid email address.', 'give' )
351
+			'error_message' => esc_html('Please enter a valid email address.', 'give')
352 352
 		),
353 353
 		'give_first' => array(
354 354
 			'error_id'      => 'invalid_first_name',
355
-			'error_message' => esc_html( 'Please enter your first name.', 'give' )
355
+			'error_message' => esc_html('Please enter your first name.', 'give')
356 356
 		)
357 357
 	);
358 358
 
359
-	$require_address = give_require_billing_address( $payment_mode );
359
+	$require_address = give_require_billing_address($payment_mode);
360 360
 
361
-	if ( $require_address ) {
362
-		$required_fields['card_address']    = array(
361
+	if ($require_address) {
362
+		$required_fields['card_address'] = array(
363 363
 			'error_id'      => 'invalid_card_address',
364
-			'error_message' => esc_html( 'Please enter your primary billing address.', 'give' )
364
+			'error_message' => esc_html('Please enter your primary billing address.', 'give')
365 365
 		);
366
-		$required_fields['card_zip']        = array(
366
+		$required_fields['card_zip'] = array(
367 367
 			'error_id'      => 'invalid_zip_code',
368
-			'error_message' => esc_html( 'Please enter your zip / postal code.', 'give' )
368
+			'error_message' => esc_html('Please enter your zip / postal code.', 'give')
369 369
 		);
370
-		$required_fields['card_city']       = array(
370
+		$required_fields['card_city'] = array(
371 371
 			'error_id'      => 'invalid_city',
372
-			'error_message' => esc_html( 'Please enter your billing city.', 'give' )
372
+			'error_message' => esc_html('Please enter your billing city.', 'give')
373 373
 		);
374 374
 		$required_fields['billing_country'] = array(
375 375
 			'error_id'      => 'invalid_country',
376
-			'error_message' => esc_html( 'Please select your billing country.', 'give' )
376
+			'error_message' => esc_html('Please select your billing country.', 'give')
377 377
 		);
378
-		$required_fields['card_state']      = array(
378
+		$required_fields['card_state'] = array(
379 379
 			'error_id'      => 'invalid_state',
380
-			'error_message' => esc_html( 'Please enter billing state / province.', 'give' )
380
+			'error_message' => esc_html('Please enter billing state / province.', 'give')
381 381
 		);
382 382
 	}
383 383
 
384
-	return apply_filters( 'give_purchase_form_required_fields', $required_fields, $form_id );
384
+	return apply_filters('give_purchase_form_required_fields', $required_fields, $form_id);
385 385
 
386 386
 }
387 387
 
@@ -394,16 +394,16 @@  discard block
 block discarded – undo
394 394
  *
395 395
  * @return mixed|void
396 396
  */
397
-function give_require_billing_address( $payment_mode ) {
397
+function give_require_billing_address($payment_mode) {
398 398
 
399 399
 	$return = false;
400 400
 
401
-	if ( isset( $_POST['billing_country'] ) || did_action( "give_{$payment_mode}_cc_form" ) || did_action( 'give_cc_form' ) ) {
401
+	if (isset($_POST['billing_country']) || did_action("give_{$payment_mode}_cc_form") || did_action('give_cc_form')) {
402 402
 		$return = true;
403 403
 	}
404 404
 
405 405
 	// Let payment gateways and other extensions determine if address fields should be required
406
-	return apply_filters( 'give_require_billing_address', $return );
406
+	return apply_filters('give_require_billing_address', $return);
407 407
 
408 408
 }
409 409
 
@@ -417,43 +417,43 @@  discard block
 block discarded – undo
417 417
 function give_purchase_form_validate_logged_in_user() {
418 418
 	global $user_ID;
419 419
 
420
-	$form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : '';
420
+	$form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : '';
421 421
 
422 422
 	// Start empty array to collect valid user data
423 423
 	$valid_user_data = array(
424 424
 		// Assume there will be errors
425
-		'user_id' => - 1
425
+		'user_id' => -1
426 426
 	);
427 427
 
428 428
 	// Verify there is a user_ID
429
-	if ( $user_ID > 0 ) {
429
+	if ($user_ID > 0) {
430 430
 		// Get the logged in user data
431
-		$user_data = get_userdata( $user_ID );
431
+		$user_data = get_userdata($user_ID);
432 432
 
433 433
 		// Loop through required fields and show error messages
434
-		foreach ( give_purchase_form_required_fields( $form_id ) as $field_name => $value ) {
435
-			if ( in_array( $value, give_purchase_form_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) {
436
-				give_set_error( $value['error_id'], $value['error_message'] );
434
+		foreach (give_purchase_form_required_fields($form_id) as $field_name => $value) {
435
+			if (in_array($value, give_purchase_form_required_fields($form_id)) && empty($_POST[$field_name])) {
436
+				give_set_error($value['error_id'], $value['error_message']);
437 437
 			}
438 438
 		}
439 439
 
440 440
 		// Verify data
441
-		if ( $user_data ) {
441
+		if ($user_data) {
442 442
 			// Collected logged in user data
443 443
 			$valid_user_data = array(
444 444
 				'user_id'    => $user_ID,
445
-				'user_email' => isset( $_POST['give_email'] ) ? sanitize_email( $_POST['give_email'] ) : $user_data->user_email,
446
-				'user_first' => isset( $_POST['give_first'] ) && ! empty( $_POST['give_first'] ) ? sanitize_text_field( $_POST['give_first'] ) : $user_data->first_name,
447
-				'user_last'  => isset( $_POST['give_last'] ) && ! empty( $_POST['give_last'] ) ? sanitize_text_field( $_POST['give_last'] ) : $user_data->last_name,
445
+				'user_email' => isset($_POST['give_email']) ? sanitize_email($_POST['give_email']) : $user_data->user_email,
446
+				'user_first' => isset($_POST['give_first']) && ! empty($_POST['give_first']) ? sanitize_text_field($_POST['give_first']) : $user_data->first_name,
447
+				'user_last'  => isset($_POST['give_last']) && ! empty($_POST['give_last']) ? sanitize_text_field($_POST['give_last']) : $user_data->last_name,
448 448
 			);
449 449
 
450
-			if ( ! is_email( $valid_user_data['user_email'] ) ) {
451
-				give_set_error( 'email_invalid', esc_html( 'Invalid email', 'give' ) );
450
+			if ( ! is_email($valid_user_data['user_email'])) {
451
+				give_set_error('email_invalid', esc_html('Invalid email', 'give'));
452 452
 			}
453 453
 
454 454
 		} else {
455 455
 			// Set invalid user error
456
-			give_set_error( 'invalid_user', esc_html( 'The user information is invalid.', 'give' ) );
456
+			give_set_error('invalid_user', esc_html('The user information is invalid.', 'give'));
457 457
 		}
458 458
 	}
459 459
 
@@ -471,90 +471,90 @@  discard block
 block discarded – undo
471 471
 function give_purchase_form_validate_new_user() {
472 472
 
473 473
 	$registering_new_user = false;
474
-	$form_id              = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : '';
474
+	$form_id              = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : '';
475 475
 
476 476
 	// Start an empty array to collect valid user data
477 477
 	$valid_user_data = array(
478 478
 		// Assume there will be errors
479
-		'user_id'    => - 1,
479
+		'user_id'    => -1,
480 480
 		// Get first name
481
-		'user_first' => isset( $_POST['give_first'] ) ? sanitize_text_field( $_POST['give_first'] ) : '',
481
+		'user_first' => isset($_POST['give_first']) ? sanitize_text_field($_POST['give_first']) : '',
482 482
 		// Get last name
483
-		'user_last'  => isset( $_POST['give_last'] ) ? sanitize_text_field( $_POST['give_last'] ) : '',
483
+		'user_last'  => isset($_POST['give_last']) ? sanitize_text_field($_POST['give_last']) : '',
484 484
 	);
485 485
 
486 486
 	// Check the new user's credentials against existing ones
487
-	$user_login   = isset( $_POST['give_user_login'] ) ? trim( $_POST['give_user_login'] ) : false;
488
-	$user_email   = isset( $_POST['give_email'] ) ? trim( $_POST['give_email'] ) : false;
489
-	$user_pass    = isset( $_POST['give_user_pass'] ) ? trim( $_POST['give_user_pass'] ) : false;
490
-	$pass_confirm = isset( $_POST['give_user_pass_confirm'] ) ? trim( $_POST['give_user_pass_confirm'] ) : false;
487
+	$user_login   = isset($_POST['give_user_login']) ? trim($_POST['give_user_login']) : false;
488
+	$user_email   = isset($_POST['give_email']) ? trim($_POST['give_email']) : false;
489
+	$user_pass    = isset($_POST['give_user_pass']) ? trim($_POST['give_user_pass']) : false;
490
+	$pass_confirm = isset($_POST['give_user_pass_confirm']) ? trim($_POST['give_user_pass_confirm']) : false;
491 491
 
492 492
 	// Loop through required fields and show error messages
493
-	foreach ( give_purchase_form_required_fields( $form_id ) as $field_name => $value ) {
494
-		if ( in_array( $value, give_purchase_form_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) {
495
-			give_set_error( $value['error_id'], $value['error_message'] );
493
+	foreach (give_purchase_form_required_fields($form_id) as $field_name => $value) {
494
+		if (in_array($value, give_purchase_form_required_fields($form_id)) && empty($_POST[$field_name])) {
495
+			give_set_error($value['error_id'], $value['error_message']);
496 496
 		}
497 497
 	}
498 498
 
499 499
 	// Check if we have an username to register
500
-	if ( $user_login && strlen( $user_login ) > 0 ) {
500
+	if ($user_login && strlen($user_login) > 0) {
501 501
 		$registering_new_user = true;
502 502
 
503 503
 		// We have an user name, check if it already exists
504
-		if ( username_exists( $user_login ) ) {
504
+		if (username_exists($user_login)) {
505 505
 			// Username already registered
506
-			give_set_error( 'username_unavailable', esc_html( 'Username already taken.', 'give' ) );
506
+			give_set_error('username_unavailable', esc_html('Username already taken.', 'give'));
507 507
 			// Check if it's valid
508
-		} else if ( ! give_validate_username( $user_login ) ) {
508
+		} else if ( ! give_validate_username($user_login)) {
509 509
 			// Invalid username
510
-			if ( is_multisite() ) {
511
-				give_set_error( 'username_invalid', esc_html( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ) );
510
+			if (is_multisite()) {
511
+				give_set_error('username_invalid', esc_html('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'));
512 512
 			} else {
513
-				give_set_error( 'username_invalid', esc_html( 'Invalid username.', 'give' ) );
513
+				give_set_error('username_invalid', esc_html('Invalid username.', 'give'));
514 514
 			}
515 515
 		} else {
516 516
 			// All the checks have run and it's good to go
517 517
 			$valid_user_data['user_login'] = $user_login;
518 518
 		}
519
-	} elseif ( give_logged_in_only( $form_id ) ) {
520
-		give_set_error( 'registration_required', esc_html( 'You must register or login to complete your donation.', 'give' ) );
519
+	} elseif (give_logged_in_only($form_id)) {
520
+		give_set_error('registration_required', esc_html('You must register or login to complete your donation.', 'give'));
521 521
 	}
522 522
 
523 523
 	// Check if we have an email to verify
524
-	if ( $user_email && strlen( $user_email ) > 0 ) {
524
+	if ($user_email && strlen($user_email) > 0) {
525 525
 		// Validate email
526
-		if ( ! is_email( $user_email ) ) {
527
-			give_set_error( 'email_invalid', esc_html( 'Sorry, that email is invalid.', 'give' ) );
526
+		if ( ! is_email($user_email)) {
527
+			give_set_error('email_invalid', esc_html('Sorry, that email is invalid.', 'give'));
528 528
 			// Check if email exists
529
-		} else if ( email_exists( $user_email ) && $registering_new_user ) {
530
-			give_set_error( 'email_used', esc_html( 'Sorry, that email already active for another user.', 'give' ) );
529
+		} else if (email_exists($user_email) && $registering_new_user) {
530
+			give_set_error('email_used', esc_html('Sorry, that email already active for another user.', 'give'));
531 531
 		} else {
532 532
 			// All the checks have run and it's good to go
533 533
 			$valid_user_data['user_email'] = $user_email;
534 534
 		}
535 535
 	} else {
536 536
 		// No email
537
-		give_set_error( 'email_empty', esc_html( 'Enter an email.', 'give' ) );
537
+		give_set_error('email_empty', esc_html('Enter an email.', 'give'));
538 538
 	}
539 539
 
540 540
 	// Check password
541
-	if ( $user_pass && $pass_confirm ) {
541
+	if ($user_pass && $pass_confirm) {
542 542
 		// Verify confirmation matches
543
-		if ( $user_pass != $pass_confirm ) {
543
+		if ($user_pass != $pass_confirm) {
544 544
 			// Passwords do not match
545
-			give_set_error( 'password_mismatch', esc_html( 'Passwords don\'t match.', 'give' ) );
545
+			give_set_error('password_mismatch', esc_html('Passwords don\'t match.', 'give'));
546 546
 		} else {
547 547
 			// All is good to go
548 548
 			$valid_user_data['user_pass'] = $user_pass;
549 549
 		}
550 550
 	} else {
551 551
 		// Password or confirmation missing
552
-		if ( ! $user_pass && $registering_new_user ) {
552
+		if ( ! $user_pass && $registering_new_user) {
553 553
 			// The password is invalid
554
-			give_set_error( 'password_empty', esc_html( 'Enter a password.', 'give' ) );
555
-		} else if ( ! $pass_confirm && $registering_new_user ) {
554
+			give_set_error('password_empty', esc_html('Enter a password.', 'give'));
555
+		} else if ( ! $pass_confirm && $registering_new_user) {
556 556
 			// Confirmation password is invalid
557
-			give_set_error( 'confirmation_empty', esc_html( 'Enter the password confirmation.', 'give' ) );
557
+			give_set_error('confirmation_empty', esc_html('Enter the password confirmation.', 'give'));
558 558
 		}
559 559
 	}
560 560
 
@@ -573,36 +573,36 @@  discard block
 block discarded – undo
573 573
 	// Start an array to collect valid user data
574 574
 	$valid_user_data = array(
575 575
 		// Assume there will be errors
576
-		'user_id' => - 1
576
+		'user_id' => -1
577 577
 	);
578 578
 
579 579
 	// Username
580
-	if ( ! isset( $_POST['give_user_login'] ) || $_POST['give_user_login'] == '' ) {
581
-		give_set_error( 'must_log_in', esc_html( 'You must login or register to complete your donation.', 'give' ) );
580
+	if ( ! isset($_POST['give_user_login']) || $_POST['give_user_login'] == '') {
581
+		give_set_error('must_log_in', esc_html('You must login or register to complete your donation.', 'give'));
582 582
 
583 583
 		return $valid_user_data;
584 584
 	}
585 585
 
586 586
 	// Get the user by login
587
-	$user_data = get_user_by( 'login', strip_tags( $_POST['give_user_login'] ) );
587
+	$user_data = get_user_by('login', strip_tags($_POST['give_user_login']));
588 588
 
589 589
 	// Check if user exists
590
-	if ( $user_data ) {
590
+	if ($user_data) {
591 591
 		// Get password
592
-		$user_pass = isset( $_POST['give_user_pass'] ) ? $_POST['give_user_pass'] : false;
592
+		$user_pass = isset($_POST['give_user_pass']) ? $_POST['give_user_pass'] : false;
593 593
 
594 594
 		// Check user_pass
595
-		if ( $user_pass ) {
595
+		if ($user_pass) {
596 596
 			// Check if password is valid
597
-			if ( ! wp_check_password( $user_pass, $user_data->user_pass, $user_data->ID ) ) {
597
+			if ( ! wp_check_password($user_pass, $user_data->user_pass, $user_data->ID)) {
598 598
 				// Incorrect password
599 599
 				give_set_error(
600 600
 					'password_incorrect',
601 601
 					sprintf(
602 602
 						'%1$s <a href="%2$s">%3$s</a>',
603
-						esc_html( 'The password you entered is incorrect.', 'give' ),
604
-						wp_lostpassword_url( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" ),
605
-						esc_html( 'Reset Password', 'give' )
603
+						esc_html('The password you entered is incorrect.', 'give'),
604
+						wp_lostpassword_url("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"),
605
+						esc_html('Reset Password', 'give')
606 606
 					)
607 607
 				);
608 608
 				// All is correct
@@ -619,11 +619,11 @@  discard block
 block discarded – undo
619 619
 			}
620 620
 		} else {
621 621
 			// Empty password
622
-			give_set_error( 'password_empty', esc_html( 'Enter a password.', 'give' ) );
622
+			give_set_error('password_empty', esc_html('Enter a password.', 'give'));
623 623
 		}
624 624
 	} else {
625 625
 		// no username
626
-		give_set_error( 'username_incorrect', esc_html( 'The username you entered does not exist.', 'give' ) );
626
+		give_set_error('username_incorrect', esc_html('The username you entered does not exist.', 'give'));
627 627
 	}
628 628
 
629 629
 	return $valid_user_data;
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
  */
639 639
 function give_purchase_form_validate_guest_user() {
640 640
 
641
-	$form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : '';
641
+	$form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : '';
642 642
 
643 643
 	// Start an array to collect valid user data
644 644
 	$valid_user_data = array(
@@ -647,32 +647,32 @@  discard block
 block discarded – undo
647 647
 	);
648 648
 
649 649
 	// Show error message if user must be logged in
650
-	if ( give_logged_in_only( $form_id ) ) {
651
-		give_set_error( 'logged_in_only', esc_html( 'You must be logged into to donate.', 'give' ) );
650
+	if (give_logged_in_only($form_id)) {
651
+		give_set_error('logged_in_only', esc_html('You must be logged into to donate.', 'give'));
652 652
 	}
653 653
 
654 654
 	// Get the guest email
655
-	$guest_email = isset( $_POST['give_email'] ) ? $_POST['give_email'] : false;
655
+	$guest_email = isset($_POST['give_email']) ? $_POST['give_email'] : false;
656 656
 
657 657
 	// Check email
658
-	if ( $guest_email && strlen( $guest_email ) > 0 ) {
658
+	if ($guest_email && strlen($guest_email) > 0) {
659 659
 		// Validate email
660
-		if ( ! is_email( $guest_email ) ) {
660
+		if ( ! is_email($guest_email)) {
661 661
 			// Invalid email
662
-			give_set_error( 'email_invalid', esc_html( 'Invalid email.', 'give' ) );
662
+			give_set_error('email_invalid', esc_html('Invalid email.', 'give'));
663 663
 		} else {
664 664
 			// All is good to go
665 665
 			$valid_user_data['user_email'] = $guest_email;
666 666
 		}
667 667
 	} else {
668 668
 		// No email
669
-		give_set_error( 'email_empty', esc_html( 'Enter an email.', 'give' ) );
669
+		give_set_error('email_empty', esc_html('Enter an email.', 'give'));
670 670
 	}
671 671
 
672 672
 	// Loop through required fields and show error messages
673
-	foreach ( give_purchase_form_required_fields( $form_id ) as $field_name => $value ) {
674
-		if ( in_array( $value, give_purchase_form_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) {
675
-			give_set_error( $value['error_id'], $value['error_message'] );
673
+	foreach (give_purchase_form_required_fields($form_id) as $field_name => $value) {
674
+		if (in_array($value, give_purchase_form_required_fields($form_id)) && empty($_POST[$field_name])) {
675
+			give_set_error($value['error_id'], $value['error_message']);
676 676
 		}
677 677
 	}
678 678
 
@@ -688,42 +688,42 @@  discard block
 block discarded – undo
688 688
  * @since   1.0
689 689
  * @return  integer
690 690
  */
691
-function give_register_and_login_new_user( $user_data = array() ) {
691
+function give_register_and_login_new_user($user_data = array()) {
692 692
 	// Verify the array
693
-	if ( empty( $user_data ) ) {
694
-		return - 1;
693
+	if (empty($user_data)) {
694
+		return -1;
695 695
 	}
696 696
 
697
-	if ( give_get_errors() ) {
698
-		return - 1;
697
+	if (give_get_errors()) {
698
+		return -1;
699 699
 	}
700 700
 
701
-	$user_args = apply_filters( 'give_insert_user_args', array(
702
-		'user_login'      => isset( $user_data['user_login'] ) ? $user_data['user_login'] : '',
703
-		'user_pass'       => isset( $user_data['user_pass'] ) ? $user_data['user_pass'] : '',
704
-		'user_email'      => isset( $user_data['user_email'] ) ? $user_data['user_email'] : '',
705
-		'first_name'      => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '',
706
-		'last_name'       => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '',
707
-		'user_registered' => date( 'Y-m-d H:i:s' ),
708
-		'role'            => get_option( 'default_role' )
709
-	), $user_data );
701
+	$user_args = apply_filters('give_insert_user_args', array(
702
+		'user_login'      => isset($user_data['user_login']) ? $user_data['user_login'] : '',
703
+		'user_pass'       => isset($user_data['user_pass']) ? $user_data['user_pass'] : '',
704
+		'user_email'      => isset($user_data['user_email']) ? $user_data['user_email'] : '',
705
+		'first_name'      => isset($user_data['user_first']) ? $user_data['user_first'] : '',
706
+		'last_name'       => isset($user_data['user_last']) ? $user_data['user_last'] : '',
707
+		'user_registered' => date('Y-m-d H:i:s'),
708
+		'role'            => get_option('default_role')
709
+	), $user_data);
710 710
 
711 711
 	// Insert new user
712
-	$user_id = wp_insert_user( $user_args );
712
+	$user_id = wp_insert_user($user_args);
713 713
 
714 714
 	// Validate inserted user
715
-	if ( is_wp_error( $user_id ) ) {
716
-		return - 1;
715
+	if (is_wp_error($user_id)) {
716
+		return -1;
717 717
 	}
718 718
 
719 719
 	// Allow themes and plugins to filter the user data
720
-	$user_data = apply_filters( 'give_insert_user_data', $user_data, $user_args );
720
+	$user_data = apply_filters('give_insert_user_data', $user_data, $user_args);
721 721
 
722 722
 	// Allow themes and plugins to hook
723
-	do_action( 'give_insert_user', $user_id, $user_data );
723
+	do_action('give_insert_user', $user_id, $user_data);
724 724
 
725 725
 	// Login new user
726
-	give_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] );
726
+	give_log_user_in($user_id, $user_data['user_login'], $user_data['user_pass']);
727 727
 
728 728
 	// Return user id
729 729
 	return $user_id;
@@ -738,27 +738,27 @@  discard block
 block discarded – undo
738 738
  * @since   1.0
739 739
  * @return  array
740 740
  */
741
-function give_get_purchase_form_user( $valid_data = array() ) {
741
+function give_get_purchase_form_user($valid_data = array()) {
742 742
 
743 743
 	// Initialize user
744 744
 	$user    = false;
745
-	$is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
745
+	$is_ajax = defined('DOING_AJAX') && DOING_AJAX;
746 746
 
747
-	if ( $is_ajax ) {
747
+	if ($is_ajax) {
748 748
 		// Do not create or login the user during the ajax submission (check for errors only)
749 749
 		return true;
750
-	} else if ( is_user_logged_in() ) {
750
+	} else if (is_user_logged_in()) {
751 751
 		// Set the valid user as the logged in collected data
752 752
 		$user = $valid_data['logged_in_user'];
753
-	} else if ( $valid_data['need_new_user'] === true || $valid_data['need_user_login'] === true ) {
753
+	} else if ($valid_data['need_new_user'] === true || $valid_data['need_user_login'] === true) {
754 754
 		// New user registration
755
-		if ( $valid_data['need_new_user'] === true ) {
755
+		if ($valid_data['need_new_user'] === true) {
756 756
 			// Set user
757 757
 			$user = $valid_data['new_user_data'];
758 758
 			// Register and login new user
759
-			$user['user_id'] = give_register_and_login_new_user( $user );
759
+			$user['user_id'] = give_register_and_login_new_user($user);
760 760
 			// User login
761
-		} else if ( $valid_data['need_user_login'] === true && ! $is_ajax ) {
761
+		} else if ($valid_data['need_user_login'] === true && ! $is_ajax) {
762 762
 
763 763
 			/*
764 764
 			 * The login form is now processed in the give_process_purchase_login() function.
@@ -773,48 +773,48 @@  discard block
 block discarded – undo
773 773
 			// Set user
774 774
 			$user = $valid_data['login_user_data'];
775 775
 			// Login user
776
-			give_log_user_in( $user['user_id'], $user['user_login'], $user['user_pass'] );
776
+			give_log_user_in($user['user_id'], $user['user_login'], $user['user_pass']);
777 777
 		}
778 778
 	}
779 779
 
780 780
 	// Check guest checkout
781
-	if ( false === $user && false === give_logged_in_only( $_POST['give-form-id'] ) ) {
781
+	if (false === $user && false === give_logged_in_only($_POST['give-form-id'])) {
782 782
 		// Set user
783 783
 		$user = $valid_data['guest_user_data'];
784 784
 	}
785 785
 
786 786
 	// Verify we have an user
787
-	if ( false === $user || empty( $user ) ) {
787
+	if (false === $user || empty($user)) {
788 788
 		// Return false
789 789
 		return false;
790 790
 	}
791 791
 
792 792
 	// Get user first name
793
-	if ( ! isset( $user['user_first'] ) || strlen( trim( $user['user_first'] ) ) < 1 ) {
794
-		$user['user_first'] = isset( $_POST['give_first'] ) ? strip_tags( trim( $_POST['give_first'] ) ) : '';
793
+	if ( ! isset($user['user_first']) || strlen(trim($user['user_first'])) < 1) {
794
+		$user['user_first'] = isset($_POST['give_first']) ? strip_tags(trim($_POST['give_first'])) : '';
795 795
 	}
796 796
 
797 797
 	// Get user last name
798
-	if ( ! isset( $user['user_last'] ) || strlen( trim( $user['user_last'] ) ) < 1 ) {
799
-		$user['user_last'] = isset( $_POST['give_last'] ) ? strip_tags( trim( $_POST['give_last'] ) ) : '';
798
+	if ( ! isset($user['user_last']) || strlen(trim($user['user_last'])) < 1) {
799
+		$user['user_last'] = isset($_POST['give_last']) ? strip_tags(trim($_POST['give_last'])) : '';
800 800
 	}
801 801
 
802 802
 	// Get the user's billing address details
803 803
 	$user['address']            = array();
804
-	$user['address']['line1']   = ! empty( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : false;
805
-	$user['address']['line2']   = ! empty( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : false;
806
-	$user['address']['city']    = ! empty( $_POST['card_city'] ) ? sanitize_text_field( $_POST['card_city'] ) : false;
807
-	$user['address']['state']   = ! empty( $_POST['card_state'] ) ? sanitize_text_field( $_POST['card_state'] ) : false;
808
-	$user['address']['country'] = ! empty( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : false;
809
-	$user['address']['zip']     = ! empty( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : false;
810
-
811
-	if ( empty( $user['address']['country'] ) ) {
804
+	$user['address']['line1']   = ! empty($_POST['card_address']) ? sanitize_text_field($_POST['card_address']) : false;
805
+	$user['address']['line2']   = ! empty($_POST['card_address_2']) ? sanitize_text_field($_POST['card_address_2']) : false;
806
+	$user['address']['city']    = ! empty($_POST['card_city']) ? sanitize_text_field($_POST['card_city']) : false;
807
+	$user['address']['state']   = ! empty($_POST['card_state']) ? sanitize_text_field($_POST['card_state']) : false;
808
+	$user['address']['country'] = ! empty($_POST['billing_country']) ? sanitize_text_field($_POST['billing_country']) : false;
809
+	$user['address']['zip']     = ! empty($_POST['card_zip']) ? sanitize_text_field($_POST['card_zip']) : false;
810
+
811
+	if (empty($user['address']['country'])) {
812 812
 		$user['address'] = false;
813 813
 	} // Country will always be set if address fields are present
814 814
 
815
-	if ( ! empty( $user['user_id'] ) && $user['user_id'] > 0 && ! empty( $user['address'] ) ) {
815
+	if ( ! empty($user['user_id']) && $user['user_id'] > 0 && ! empty($user['address'])) {
816 816
 		// Store the address in the user's meta so the donation form can be pre-populated with it on return purchases
817
-		update_user_meta( $user['user_id'], '_give_user_address', $user['address'] );
817
+		update_user_meta($user['user_id'], '_give_user_address', $user['address']);
818 818
 	}
819 819
 
820 820
 	// Return valid user
@@ -833,16 +833,16 @@  discard block
 block discarded – undo
833 833
 	$card_data = give_get_purchase_cc_info();
834 834
 
835 835
 	// Validate the card zip
836
-	if ( ! empty( $card_data['card_zip'] ) ) {
837
-		if ( ! give_purchase_form_validate_cc_zip( $card_data['card_zip'], $card_data['card_country'] ) ) {
838
-			give_set_error( 'invalid_cc_zip', esc_html( 'The zip / postal code you entered for your billing address is invalid.', 'give' ) );
836
+	if ( ! empty($card_data['card_zip'])) {
837
+		if ( ! give_purchase_form_validate_cc_zip($card_data['card_zip'], $card_data['card_country'])) {
838
+			give_set_error('invalid_cc_zip', esc_html('The zip / postal code you entered for your billing address is invalid.', 'give'));
839 839
 		}
840 840
 	}
841 841
 
842 842
 	//Ensure no spaces
843
-	if ( ! empty( $card_data['card_number'] ) ) {
844
-		$card_data['card_number'] = str_replace( '+', '', $card_data['card_number'] ); //no "+" signs
845
-		$card_data['card_number'] = str_replace( ' ', '', $card_data['card_number'] ); // No spaces
843
+	if ( ! empty($card_data['card_number'])) {
844
+		$card_data['card_number'] = str_replace('+', '', $card_data['card_number']); //no "+" signs
845
+		$card_data['card_number'] = str_replace(' ', '', $card_data['card_number']); // No spaces
846 846
 	}
847 847
 
848 848
 	// This should validate card numbers at some point too
@@ -858,17 +858,17 @@  discard block
 block discarded – undo
858 858
  */
859 859
 function give_get_purchase_cc_info() {
860 860
 	$cc_info                   = array();
861
-	$cc_info['card_name']      = isset( $_POST['card_name'] ) ? sanitize_text_field( $_POST['card_name'] ) : '';
862
-	$cc_info['card_number']    = isset( $_POST['card_number'] ) ? sanitize_text_field( $_POST['card_number'] ) : '';
863
-	$cc_info['card_cvc']       = isset( $_POST['card_cvc'] ) ? sanitize_text_field( $_POST['card_cvc'] ) : '';
864
-	$cc_info['card_exp_month'] = isset( $_POST['card_exp_month'] ) ? sanitize_text_field( $_POST['card_exp_month'] ) : '';
865
-	$cc_info['card_exp_year']  = isset( $_POST['card_exp_year'] ) ? sanitize_text_field( $_POST['card_exp_year'] ) : '';
866
-	$cc_info['card_address']   = isset( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : '';
867
-	$cc_info['card_address_2'] = isset( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : '';
868
-	$cc_info['card_city']      = isset( $_POST['card_city'] ) ? sanitize_text_field( $_POST['card_city'] ) : '';
869
-	$cc_info['card_state']     = isset( $_POST['card_state'] ) ? sanitize_text_field( $_POST['card_state'] ) : '';
870
-	$cc_info['card_country']   = isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : '';
871
-	$cc_info['card_zip']       = isset( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : '';
861
+	$cc_info['card_name']      = isset($_POST['card_name']) ? sanitize_text_field($_POST['card_name']) : '';
862
+	$cc_info['card_number']    = isset($_POST['card_number']) ? sanitize_text_field($_POST['card_number']) : '';
863
+	$cc_info['card_cvc']       = isset($_POST['card_cvc']) ? sanitize_text_field($_POST['card_cvc']) : '';
864
+	$cc_info['card_exp_month'] = isset($_POST['card_exp_month']) ? sanitize_text_field($_POST['card_exp_month']) : '';
865
+	$cc_info['card_exp_year']  = isset($_POST['card_exp_year']) ? sanitize_text_field($_POST['card_exp_year']) : '';
866
+	$cc_info['card_address']   = isset($_POST['card_address']) ? sanitize_text_field($_POST['card_address']) : '';
867
+	$cc_info['card_address_2'] = isset($_POST['card_address_2']) ? sanitize_text_field($_POST['card_address_2']) : '';
868
+	$cc_info['card_city']      = isset($_POST['card_city']) ? sanitize_text_field($_POST['card_city']) : '';
869
+	$cc_info['card_state']     = isset($_POST['card_state']) ? sanitize_text_field($_POST['card_state']) : '';
870
+	$cc_info['card_country']   = isset($_POST['billing_country']) ? sanitize_text_field($_POST['billing_country']) : '';
871
+	$cc_info['card_zip']       = isset($_POST['card_zip']) ? sanitize_text_field($_POST['card_zip']) : '';
872 872
 
873 873
 	// Return cc info
874 874
 	return $cc_info;
@@ -884,14 +884,14 @@  discard block
 block discarded – undo
884 884
  *
885 885
  * @return bool|mixed|void
886 886
  */
887
-function give_purchase_form_validate_cc_zip( $zip = 0, $country_code = '' ) {
887
+function give_purchase_form_validate_cc_zip($zip = 0, $country_code = '') {
888 888
 	$ret = false;
889 889
 
890
-	if ( empty( $zip ) || empty( $country_code ) ) {
890
+	if (empty($zip) || empty($country_code)) {
891 891
 		return $ret;
892 892
 	}
893 893
 
894
-	$country_code = strtoupper( $country_code );
894
+	$country_code = strtoupper($country_code);
895 895
 
896 896
 	$zip_regex = array(
897 897
 		"AD" => "AD\d{3}",
@@ -1051,9 +1051,9 @@  discard block
 block discarded – undo
1051 1051
 		"ZM" => "\d{5}"
1052 1052
 	);
1053 1053
 
1054
-	if ( ! isset ( $zip_regex[ $country_code ] ) || preg_match( "/" . $zip_regex[ $country_code ] . "/i", $zip ) ) {
1054
+	if ( ! isset ($zip_regex[$country_code]) || preg_match("/".$zip_regex[$country_code]."/i", $zip)) {
1055 1055
 		$ret = true;
1056 1056
 	}
1057 1057
 
1058
-	return apply_filters( 'give_is_zip_valid', $ret, $zip, $country_code );
1058
+	return apply_filters('give_is_zip_valid', $ret, $zip, $country_code);
1059 1059
 }
1060 1060
\ No newline at end of file
Please login to merge, or discard this patch.
includes/user-functions.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@
 block discarded – undo
270 270
  * @access      public
271 271
  * @since       1.0
272 272
  *
273
- * @param       $username string - the username to validate
273
+ * @param       string $username string - the username to validate
274 274
  *
275 275
  * @return      bool
276 276
  */
Please login to merge, or discard this patch.
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -30,36 +30,36 @@  discard block
 block discarded – undo
30 30
  *
31 31
  * @return bool|object List of all user purchases
32 32
  */
33
-function give_get_users_purchases( $user = 0, $number = 20, $pagination = false, $status = 'complete' ) {
33
+function give_get_users_purchases($user = 0, $number = 20, $pagination = false, $status = 'complete') {
34 34
 
35
-	if ( empty( $user ) ) {
35
+	if (empty($user)) {
36 36
 		$user = get_current_user_id();
37 37
 	}
38 38
 
39
-	if ( 0 === $user && ! Give()->email_access->token_exists ) {
39
+	if (0 === $user && ! Give()->email_access->token_exists) {
40 40
 		return false;
41 41
 	}
42 42
 
43 43
 	$status = $status === 'complete' ? 'publish' : $status;
44 44
 
45
-	if ( $pagination ) {
46
-		if ( get_query_var( 'paged' ) ) {
47
-			$paged = get_query_var( 'paged' );
48
-		} else if ( get_query_var( 'page' ) ) {
49
-			$paged = get_query_var( 'page' );
45
+	if ($pagination) {
46
+		if (get_query_var('paged')) {
47
+			$paged = get_query_var('paged');
48
+		} else if (get_query_var('page')) {
49
+			$paged = get_query_var('page');
50 50
 		} else {
51 51
 			$paged = 1;
52 52
 		}
53 53
 	}
54 54
 
55
-	$args = apply_filters( 'give_get_users_purchases_args', array(
55
+	$args = apply_filters('give_get_users_purchases_args', array(
56 56
 		'user'    => $user,
57 57
 		'number'  => $number,
58 58
 		'status'  => $status,
59 59
 		'orderby' => 'date'
60
-	) );
60
+	));
61 61
 
62
-	if ( $pagination ) {
62
+	if ($pagination) {
63 63
 
64 64
 		$args['page'] = $paged;
65 65
 
@@ -69,20 +69,20 @@  discard block
 block discarded – undo
69 69
 
70 70
 	}
71 71
 
72
-	$by_user_id = is_numeric( $user ) ? true : false;
73
-	$customer   = new Give_Customer( $user, $by_user_id );
72
+	$by_user_id = is_numeric($user) ? true : false;
73
+	$customer   = new Give_Customer($user, $by_user_id);
74 74
 
75
-	if ( ! empty( $customer->payment_ids ) ) {
75
+	if ( ! empty($customer->payment_ids)) {
76 76
 
77
-		unset( $args['user'] );
78
-		$args['post__in'] = array_map( 'absint', explode( ',', $customer->payment_ids ) );
77
+		unset($args['user']);
78
+		$args['post__in'] = array_map('absint', explode(',', $customer->payment_ids));
79 79
 
80 80
 	}
81 81
 
82
-	$purchases = give_get_payments( apply_filters( 'give_get_users_purchases_args', $args ) );
82
+	$purchases = give_get_payments(apply_filters('give_get_users_purchases_args', $args));
83 83
 
84 84
 	// No purchases
85
-	if ( ! $purchases ) {
85
+	if ( ! $purchases) {
86 86
 		return false;
87 87
 	}
88 88
 
@@ -101,65 +101,65 @@  discard block
 block discarded – undo
101 101
  *
102 102
  * @return bool|object List of unique forms purchased by user
103 103
  */
104
-function give_get_users_completed_donations( $user = 0, $status = 'complete' ) {
105
-	if ( empty( $user ) ) {
104
+function give_get_users_completed_donations($user = 0, $status = 'complete') {
105
+	if (empty($user)) {
106 106
 		$user = get_current_user_id();
107 107
 	}
108 108
 
109
-	if ( empty( $user ) ) {
109
+	if (empty($user)) {
110 110
 		return false;
111 111
 	}
112 112
 
113
-	$by_user_id = is_numeric( $user ) ? true : false;
113
+	$by_user_id = is_numeric($user) ? true : false;
114 114
 
115
-	$customer = new Give_Customer( $user, $by_user_id );
115
+	$customer = new Give_Customer($user, $by_user_id);
116 116
 
117
-	if ( empty( $customer->payment_ids ) ) {
117
+	if (empty($customer->payment_ids)) {
118 118
 		return false;
119 119
 	}
120 120
 
121 121
 	// Get all the items purchased
122
-	$payment_ids    = array_reverse( explode( ',', $customer->payment_ids ) );
123
-	$limit_payments = apply_filters( 'give_users_completed_donations_payments', 50 );
124
-	if ( ! empty( $limit_payments ) ) {
125
-		$payment_ids = array_slice( $payment_ids, 0, $limit_payments );
122
+	$payment_ids    = array_reverse(explode(',', $customer->payment_ids));
123
+	$limit_payments = apply_filters('give_users_completed_donations_payments', 50);
124
+	if ( ! empty($limit_payments)) {
125
+		$payment_ids = array_slice($payment_ids, 0, $limit_payments);
126 126
 	}
127 127
 	$donation_data = array();
128
-	foreach ( $payment_ids as $payment_id ) {
129
-		$donation_data[] = give_get_payment_meta( $payment_id );
128
+	foreach ($payment_ids as $payment_id) {
129
+		$donation_data[] = give_get_payment_meta($payment_id);
130 130
 	}
131 131
 
132
-	if ( empty( $donation_data ) ) {
132
+	if (empty($donation_data)) {
133 133
 		return false;
134 134
 	}
135 135
 
136 136
 	// Grab only the post ids "form_id" of the forms purchased on this order
137 137
 	$completed_donations_ids = array();
138
-	foreach ( $donation_data as $purchase_meta ) {
138
+	foreach ($donation_data as $purchase_meta) {
139 139
 		$completed_donations_ids[] = isset($purchase_meta['form_id']) ? $purchase_meta['form_id'] : '';
140 140
 	}
141 141
 
142
-	if ( empty( $completed_donations_ids ) ) {
142
+	if (empty($completed_donations_ids)) {
143 143
 		return false;
144 144
 	}
145 145
 
146 146
 	// Only include each product purchased once
147
-	$form_ids = array_unique( $completed_donations_ids );
147
+	$form_ids = array_unique($completed_donations_ids);
148 148
 
149 149
 	// Make sure we still have some products and a first item
150
-	if ( empty ( $form_ids ) || ! isset( $form_ids[0] ) ) {
150
+	if (empty ($form_ids) || ! isset($form_ids[0])) {
151 151
 		return false;
152 152
 	}
153 153
 
154
-	$post_type = get_post_type( $form_ids[0] );
154
+	$post_type = get_post_type($form_ids[0]);
155 155
 
156
-	$args = apply_filters( 'give_get_users_completed_donations_args', array(
156
+	$args = apply_filters('give_get_users_completed_donations_args', array(
157 157
 		'include'        => $form_ids,
158 158
 		'post_type'      => $post_type,
159
-		'posts_per_page' => - 1
160
-	) );
159
+		'posts_per_page' => -1
160
+	));
161 161
 
162
-	return apply_filters( 'give_users_completed_donations_list', get_posts( $args ) );
162
+	return apply_filters('give_users_completed_donations_list', get_posts($args));
163 163
 }
164 164
 
165 165
 
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
  *
176 176
  * @return      bool - true if has purchased, false other wise.
177 177
  */
178
-function give_has_purchases( $user_id = null ) {
179
-	if ( empty( $user_id ) ) {
178
+function give_has_purchases($user_id = null) {
179
+	if (empty($user_id)) {
180 180
 		$user_id = get_current_user_id();
181 181
 	}
182 182
 
183
-	if ( give_get_users_purchases( $user_id, 1 ) ) {
183
+	if (give_get_users_purchases($user_id, 1)) {
184 184
 		return true; // User has at least one purchase
185 185
 	}
186 186
 
@@ -200,32 +200,32 @@  discard block
 block discarded – undo
200 200
  *
201 201
  * @return      array
202 202
  */
203
-function give_get_purchase_stats_by_user( $user = '' ) {
203
+function give_get_purchase_stats_by_user($user = '') {
204 204
 
205
-	if ( is_email( $user ) ) {
205
+	if (is_email($user)) {
206 206
 
207 207
 		$field = 'email';
208 208
 
209
-	} elseif ( is_numeric( $user ) ) {
209
+	} elseif (is_numeric($user)) {
210 210
 
211 211
 		$field = 'user_id';
212 212
 
213 213
 	}
214 214
 
215 215
 	$stats    = array();
216
-	$customer = Give()->customers->get_customer_by( $field, $user );
216
+	$customer = Give()->customers->get_customer_by($field, $user);
217 217
 
218
-	if ( $customer ) {
218
+	if ($customer) {
219 219
 
220
-		$customer = new Give_Customer( $customer->id );
220
+		$customer = new Give_Customer($customer->id);
221 221
 
222
-		$stats['purchases']   = absint( $customer->purchase_count );
223
-		$stats['total_spent'] = give_sanitize_amount( $customer->purchase_value );
222
+		$stats['purchases']   = absint($customer->purchase_count);
223
+		$stats['total_spent'] = give_sanitize_amount($customer->purchase_value);
224 224
 
225 225
 	}
226 226
 
227 227
 
228
-	return (array) apply_filters( 'give_purchase_stats_by_user', $stats, $user );
228
+	return (array) apply_filters('give_purchase_stats_by_user', $stats, $user);
229 229
 }
230 230
 
231 231
 
@@ -241,22 +241,22 @@  discard block
 block discarded – undo
241 241
  *
242 242
  * @return      int - the total number of purchases
243 243
  */
244
-function give_count_purchases_of_customer( $user = null ) {
244
+function give_count_purchases_of_customer($user = null) {
245 245
 
246 246
 	//Logged in?
247
-	if ( empty( $user ) ) {
247
+	if (empty($user)) {
248 248
 		$user = get_current_user_id();
249 249
 	}
250 250
 
251 251
 	//Email access?
252
-	if ( empty( $user ) && Give()->email_access->token_email ) {
252
+	if (empty($user) && Give()->email_access->token_email) {
253 253
 		$user = Give()->email_access->token_email;
254 254
 	}
255 255
 
256 256
 
257
-	$stats = ! empty( $user ) ? give_get_purchase_stats_by_user( $user ) : false;
257
+	$stats = ! empty($user) ? give_get_purchase_stats_by_user($user) : false;
258 258
 
259
-	return isset( $stats['purchases'] ) ? $stats['purchases'] : 0;
259
+	return isset($stats['purchases']) ? $stats['purchases'] : 0;
260 260
 }
261 261
 
262 262
 /**
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
  *
270 270
  * @return      float - the total amount the user has spent
271 271
  */
272
-function give_purchase_total_of_user( $user = null ) {
272
+function give_purchase_total_of_user($user = null) {
273 273
 
274
-	$stats = give_get_purchase_stats_by_user( $user );
274
+	$stats = give_get_purchase_stats_by_user($user);
275 275
 
276 276
 	return $stats['total_spent'];
277 277
 }
@@ -287,11 +287,11 @@  discard block
 block discarded – undo
287 287
  *
288 288
  * @return      bool
289 289
  */
290
-function give_validate_username( $username ) {
291
-	$sanitized = sanitize_user( $username, false );
292
-	$valid     = ( $sanitized == $username );
290
+function give_validate_username($username) {
291
+	$sanitized = sanitize_user($username, false);
292
+	$valid     = ($sanitized == $username);
293 293
 
294
-	return (bool) apply_filters( 'give_validate_username', $valid, $username );
294
+	return (bool) apply_filters('give_validate_username', $valid, $username);
295 295
 }
296 296
 
297 297
 
@@ -308,32 +308,32 @@  discard block
 block discarded – undo
308 308
  *
309 309
  * @return      void
310 310
  */
311
-function give_add_past_purchases_to_new_user( $user_id ) {
311
+function give_add_past_purchases_to_new_user($user_id) {
312 312
 
313
-	$email = get_the_author_meta( 'user_email', $user_id );
313
+	$email = get_the_author_meta('user_email', $user_id);
314 314
 
315
-	$payments = give_get_payments( array( 's' => $email ) );
315
+	$payments = give_get_payments(array('s' => $email));
316 316
 
317
-	if ( $payments ) {
318
-		foreach ( $payments as $payment ) {
319
-			if ( intval( give_get_payment_user_id( $payment->ID ) ) > 0 ) {
317
+	if ($payments) {
318
+		foreach ($payments as $payment) {
319
+			if (intval(give_get_payment_user_id($payment->ID)) > 0) {
320 320
 				continue;
321 321
 			} // This payment already associated with an account
322 322
 
323
-			$meta                    = give_get_payment_meta( $payment->ID );
324
-			$meta['user_info']       = maybe_unserialize( $meta['user_info'] );
323
+			$meta                    = give_get_payment_meta($payment->ID);
324
+			$meta['user_info']       = maybe_unserialize($meta['user_info']);
325 325
 			$meta['user_info']['id'] = $user_id;
326 326
 			$meta['user_info']       = $meta['user_info'];
327 327
 
328 328
 			// Store the updated user ID in the payment meta
329
-			give_update_payment_meta( $payment->ID, '_give_payment_meta', $meta );
330
-			give_update_payment_meta( $payment->ID, '_give_payment_user_id', $user_id );
329
+			give_update_payment_meta($payment->ID, '_give_payment_meta', $meta);
330
+			give_update_payment_meta($payment->ID, '_give_payment_user_id', $user_id);
331 331
 		}
332 332
 	}
333 333
 
334 334
 }
335 335
 
336
-add_action( 'user_register', 'give_add_past_purchases_to_new_user' );
336
+add_action('user_register', 'give_add_past_purchases_to_new_user');
337 337
 
338 338
 
339 339
 /**
@@ -355,34 +355,34 @@  discard block
 block discarded – undo
355 355
  * @since         1.0
356 356
  * @return        array - The donor's address, if any
357 357
  */
358
-function give_get_donor_address( $user_id = 0 ) {
359
-	if ( empty( $user_id ) ) {
358
+function give_get_donor_address($user_id = 0) {
359
+	if (empty($user_id)) {
360 360
 		$user_id = get_current_user_id();
361 361
 	}
362 362
 
363
-	$address = get_user_meta( $user_id, '_give_user_address', true );
363
+	$address = get_user_meta($user_id, '_give_user_address', true);
364 364
 
365
-	if ( ! isset( $address['line1'] ) ) {
365
+	if ( ! isset($address['line1'])) {
366 366
 		$address['line1'] = '';
367 367
 	}
368 368
 
369
-	if ( ! isset( $address['line2'] ) ) {
369
+	if ( ! isset($address['line2'])) {
370 370
 		$address['line2'] = '';
371 371
 	}
372 372
 
373
-	if ( ! isset( $address['city'] ) ) {
373
+	if ( ! isset($address['city'])) {
374 374
 		$address['city'] = '';
375 375
 	}
376 376
 
377
-	if ( ! isset( $address['zip'] ) ) {
377
+	if ( ! isset($address['zip'])) {
378 378
 		$address['zip'] = '';
379 379
 	}
380 380
 
381
-	if ( ! isset( $address['country'] ) ) {
381
+	if ( ! isset($address['country'])) {
382 382
 		$address['country'] = '';
383 383
 	}
384 384
 
385
-	if ( ! isset( $address['state'] ) ) {
385
+	if ( ! isset($address['state'])) {
386 386
 		$address['state'] = '';
387 387
 	}
388 388
 
@@ -402,42 +402,42 @@  discard block
 block discarded – undo
402 402
  *
403 403
  * @return        void
404 404
  */
405
-function give_new_user_notification( $user_id = 0, $user_data = array() ) {
405
+function give_new_user_notification($user_id = 0, $user_data = array()) {
406 406
 
407
-	if ( empty( $user_id ) || empty( $user_data ) ) {
407
+	if (empty($user_id) || empty($user_data)) {
408 408
 		return;
409 409
 	}
410
-	$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
410
+	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
411 411
 
412 412
 	/* translators: %s: site name */
413
-	$message  = sprintf( esc_html( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
413
+	$message  = sprintf(esc_html('New user registration on your site %s:'), $blogname)."\r\n\r\n";
414 414
 	/* translators: %s: user login */
415
-	$message .= sprintf( esc_html( 'Username: %s' ), $user_data['user_login'] ) . "\r\n\r\n";
415
+	$message .= sprintf(esc_html('Username: %s'), $user_data['user_login'])."\r\n\r\n";
416 416
 	/* translators: %s: user email */
417
-	$message .= sprintf( esc_html( 'E-mail: %s' ), $user_data['user_email'] ) . "\r\n";
417
+	$message .= sprintf(esc_html('E-mail: %s'), $user_data['user_email'])."\r\n";
418 418
 
419 419
 	@wp_mail(
420
-		get_option( 'admin_email' ),
420
+		get_option('admin_email'),
421 421
 		sprintf(
422 422
 			/* translators: %s: site name */
423
-			esc_html( '[%s] New User Registration' ),
423
+			esc_html('[%s] New User Registration'),
424 424
 			$blogname
425 425
 		),
426 426
 		$message
427 427
 	);
428 428
 
429 429
 	/* translators: %s: user login */
430
-	$message  = sprintf( esc_html( 'Username: %s' ), $user_data['user_login'] ) . "\r\n";
430
+	$message  = sprintf(esc_html('Username: %s'), $user_data['user_login'])."\r\n";
431 431
 	/* translators: %s: paswword */
432
-	$message .= sprintf( esc_html( 'Password: %s' ), esc_html( '[Password entered during donation]', 'give' ) ) . "\r\n";
432
+	$message .= sprintf(esc_html('Password: %s'), esc_html('[Password entered during donation]', 'give'))."\r\n";
433 433
 
434
-	$message .= '<a href="' . wp_login_url() . '"> ' . esc_html( 'Click Here to Login', 'give' ) . ' &raquo;</a>' . "\r\n";
434
+	$message .= '<a href="'.wp_login_url().'"> '.esc_html('Click Here to Login', 'give').' &raquo;</a>'."\r\n";
435 435
 
436 436
 	wp_mail(
437 437
 		$user_data['user_email'],
438 438
 		sprintf(
439 439
 			/* translators: %s: site name */
440
-			esc_html( '[%s] Your username and password' ),
440
+			esc_html('[%s] Your username and password'),
441 441
 			$blogname
442 442
 		),
443 443
 		$message
@@ -445,4 +445,4 @@  discard block
 block discarded – undo
445 445
 
446 446
 }
447 447
 
448
-add_action( 'give_insert_user', 'give_new_user_notification', 10, 2 );
448
+add_action('give_insert_user', 'give_new_user_notification', 10, 2);
Please login to merge, or discard this patch.
includes/actions.php 1 patch
Spacing   +7 added lines, -7 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,12 +23,12 @@  discard block
 block discarded – undo
23 23
  * @return void
24 24
  */
25 25
 function give_get_actions() {
26
-	if ( isset( $_GET['give_action'] ) ) {
27
-		do_action( 'give_' . $_GET['give_action'], $_GET );
26
+	if (isset($_GET['give_action'])) {
27
+		do_action('give_'.$_GET['give_action'], $_GET);
28 28
 	}
29 29
 }
30 30
 
31
-add_action( 'init', 'give_get_actions' );
31
+add_action('init', 'give_get_actions');
32 32
 
33 33
 /**
34 34
  * Hooks Give actions, when present in the $_POST superglobal. Every give_action
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
  * @return void
40 40
  */
41 41
 function give_post_actions() {
42
-	if ( isset( $_POST['give_action'] ) ) {
43
-		do_action( 'give_' . $_POST['give_action'], $_POST );
42
+	if (isset($_POST['give_action'])) {
43
+		do_action('give_'.$_POST['give_action'], $_POST);
44 44
 	}
45 45
 }
46 46
 
47
-add_action( 'init', 'give_post_actions' );
48 47
\ No newline at end of file
48
+add_action('init', 'give_post_actions');
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/admin-actions.php 1 patch
Spacing   +6 added lines, -6 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
 
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
  * @return void
23 23
  */
24 24
 function give_process_actions() {
25
-	if ( isset( $_POST['give-action'] ) ) {
26
-		do_action( 'give_' . $_POST['give-action'], $_POST );
25
+	if (isset($_POST['give-action'])) {
26
+		do_action('give_'.$_POST['give-action'], $_POST);
27 27
 	}
28 28
 
29
-	if ( isset( $_GET['give-action'] ) ) {
30
-		do_action( 'give_' . $_GET['give-action'], $_GET );
29
+	if (isset($_GET['give-action'])) {
30
+		do_action('give_'.$_GET['give-action'], $_GET);
31 31
 	}
32 32
 }
33 33
 
34
-add_action( 'admin_init', 'give_process_actions' );
35 34
\ No newline at end of file
35
+add_action('admin_init', 'give_process_actions');
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/customers/customer-functions.php 1 patch
Spacing   +12 added lines, -12 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,7 +23,7 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array        The altered list of views
25 25
  */
26
-function give_register_default_customer_views( $views ) {
26
+function give_register_default_customer_views($views) {
27 27
 
28 28
 	$default_views = array(
29 29
 		'overview' => 'give_customers_view',
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 		'notes'    => 'give_customer_notes_view'
32 32
 	);
33 33
 
34
-	return array_merge( $views, $default_views );
34
+	return array_merge($views, $default_views);
35 35
 
36 36
 }
37 37
 
38
-add_filter( 'give_customer_views', 'give_register_default_customer_views', 1, 1 );
38
+add_filter('give_customer_views', 'give_register_default_customer_views', 1, 1);
39 39
 
40 40
 /**
41 41
  * Register a tab for the single customer view
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @return array       The altered list of tabs
48 48
  */
49
-function give_register_default_customer_tabs( $tabs ) {
49
+function give_register_default_customer_tabs($tabs) {
50 50
 
51 51
 	$default_tabs = array(
52
-		'overview' => array( 'dashicon' => 'dashicons-admin-users', 'title' => __( 'Donor Profile', 'give' ) ),
53
-		'notes'    => array( 'dashicon' => 'dashicons-admin-comments', 'title' => __( 'Donor Notes', 'give' ) )
52
+		'overview' => array('dashicon' => 'dashicons-admin-users', 'title' => __('Donor Profile', 'give')),
53
+		'notes'    => array('dashicon' => 'dashicons-admin-comments', 'title' => __('Donor Notes', 'give'))
54 54
 	);
55 55
 
56
-	return array_merge( $tabs, $default_tabs );
56
+	return array_merge($tabs, $default_tabs);
57 57
 }
58 58
 
59
-add_filter( 'give_customer_tabs', 'give_register_default_customer_tabs', 1, 1 );
59
+add_filter('give_customer_tabs', 'give_register_default_customer_tabs', 1, 1);
60 60
 
61 61
 /**
62 62
  * Register the Delete icon as late as possible so it's at the bottom
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
  *
68 68
  * @return array       The altered list of tabs, with 'delete' at the bottom
69 69
  */
70
-function give_register_delete_customer_tab( $tabs ) {
70
+function give_register_delete_customer_tab($tabs) {
71 71
 
72
-	$tabs['delete'] = array( 'dashicon' => 'dashicons-trash', 'title' => __( 'Delete Donor', 'give' ) );
72
+	$tabs['delete'] = array('dashicon' => 'dashicons-trash', 'title' => __('Delete Donor', 'give'));
73 73
 
74 74
 	return $tabs;
75 75
 }
76 76
 
77
-add_filter( 'give_customer_tabs', 'give_register_delete_customer_tab', PHP_INT_MAX, 1 );
77
+add_filter('give_customer_tabs', 'give_register_delete_customer_tab', PHP_INT_MAX, 1);
Please login to merge, or discard this patch.
includes/admin/payments/payments-history.php 2 patches
Braces   +15 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
 */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) exit;
13
+if ( ! defined( 'ABSPATH' ) ) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * Payment History Page
@@ -63,11 +65,13 @@  discard block
 block discarded – undo
63 65
  */
64 66
 function give_view_order_details_title( $admin_title, $title ) {
65 67
 
66
-	if ( 'give_forms_page_give-payment-history' != get_current_screen()->base )
67
-		return $admin_title;
68
+	if ( 'give_forms_page_give-payment-history' != get_current_screen()->base ) {
69
+			return $admin_title;
70
+	}
68 71
 
69
-	if( ! isset( $_GET['give-action'] ) )
70
-		return $admin_title;
72
+	if( ! isset( $_GET['give-action'] ) ) {
73
+			return $admin_title;
74
+	}
71 75
 
72 76
 	switch( $_GET['give-action'] ) :
73 77
 
@@ -99,11 +103,13 @@  discard block
 block discarded – undo
99 103
 function give_override_edit_post_for_payment_link( $url, $post_id = 0, $context ) {
100 104
 
101 105
 	$post = get_post( $post_id );
102
-	if( ! $post )
103
-		return $url;
106
+	if( ! $post ) {
107
+			return $url;
108
+	}
104 109
 
105
-	if( 'give_payment' != $post->post_type )
106
-		return $url;
110
+	if( 'give_payment' != $post->post_type ) {
111
+			return $url;
112
+	}
107 113
 
108 114
 	$url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $post_id );
109 115
 
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 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' ) ) exit;
13
+if ( ! defined('ABSPATH')) exit;
14 14
 
15 15
 /**
16 16
  * Payment History Page
@@ -24,19 +24,19 @@  discard block
 block discarded – undo
24 24
 function give_payment_history_page() {
25 25
 	global $give_options;
26 26
 
27
-	$give_payment = get_post_type_object( 'give_payment' );
27
+	$give_payment = get_post_type_object('give_payment');
28 28
 
29
-	if ( isset( $_GET['view'] ) && 'view-order-details' == $_GET['view'] ) {
30
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/view-order-details.php';
29
+	if (isset($_GET['view']) && 'view-order-details' == $_GET['view']) {
30
+		require_once GIVE_PLUGIN_DIR.'includes/admin/payments/view-order-details.php';
31 31
 	} else {
32
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/class-payments-table.php';
32
+		require_once GIVE_PLUGIN_DIR.'includes/admin/payments/class-payments-table.php';
33 33
 		$payments_table = new Give_Payment_History_Table();
34 34
 		$payments_table->prepare_items();
35 35
 	?>
36 36
 	<div class="wrap">
37 37
 		<h2><?php echo $give_payment->labels->menu_name ?></h2>
38
-		<?php do_action( 'give_payments_page_top' ); ?>
39
-		<form id="give-payments-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>">
38
+		<?php do_action('give_payments_page_top'); ?>
39
+		<form id="give-payments-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>">
40 40
 			<input type="hidden" name="post_type" value="give_forms" />
41 41
 			<input type="hidden" name="page" value="give-payment-history" />
42 42
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 			
47 47
 			<?php $payments_table->display() ?>
48 48
 		</form>
49
-		<?php do_action( 'give_payments_page_bottom' ); ?>
49
+		<?php do_action('give_payments_page_bottom'); ?>
50 50
 	</div>
51 51
 <?php
52 52
 	}
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
  * @param $title
62 62
  * @return string
63 63
  */
64
-function give_view_order_details_title( $admin_title, $title ) {
64
+function give_view_order_details_title($admin_title, $title) {
65 65
 
66
-	if ( 'give_forms_page_give-payment-history' != get_current_screen()->base )
66
+	if ('give_forms_page_give-payment-history' != get_current_screen()->base)
67 67
 		return $admin_title;
68 68
 
69
-	if( ! isset( $_GET['give-action'] ) )
69
+	if ( ! isset($_GET['give-action']))
70 70
 		return $admin_title;
71 71
 
72
-	switch( $_GET['give-action'] ) :
72
+	switch ($_GET['give-action']) :
73 73
 
74 74
 		case 'view-order-details' :
75
-			$title = esc_html( 'View Donation Details', 'give' ) . ' - ' . $admin_title;
75
+			$title = esc_html('View Donation Details', 'give').' - '.$admin_title;
76 76
 			break;
77 77
 		case 'edit-payment' :
78
-			$title = esc_html( 'Edit Payment', 'give' ) . ' - ' . $admin_title;
78
+			$title = esc_html('Edit Payment', 'give').' - '.$admin_title;
79 79
 			break;
80 80
 		default:
81 81
 			$title = $admin_title;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
 	return $title;
86 86
 }
87
-add_filter( 'admin_title', 'give_view_order_details_title', 10, 2 );
87
+add_filter('admin_title', 'give_view_order_details_title', 10, 2);
88 88
 
89 89
 /**
90 90
  * Intercept default Edit post links for Give payments and rewrite them to the View Order Details screen
@@ -96,17 +96,17 @@  discard block
 block discarded – undo
96 96
  * @param $context
97 97
  * @return string
98 98
  */
99
-function give_override_edit_post_for_payment_link( $url, $post_id = 0, $context ) {
99
+function give_override_edit_post_for_payment_link($url, $post_id = 0, $context) {
100 100
 
101
-	$post = get_post( $post_id );
102
-	if( ! $post )
101
+	$post = get_post($post_id);
102
+	if ( ! $post)
103 103
 		return $url;
104 104
 
105
-	if( 'give_payment' != $post->post_type )
105
+	if ('give_payment' != $post->post_type)
106 106
 		return $url;
107 107
 
108
-	$url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $post_id );
108
+	$url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$post_id);
109 109
 
110 110
 	return $url;
111 111
 }
112
-add_filter( 'get_edit_post_link', 'give_override_edit_post_for_payment_link', 10, 3 );
112
+add_filter('get_edit_post_link', 'give_override_edit_post_for_payment_link', 10, 3);
Please login to merge, or discard this patch.
includes/admin/payments/view-order-details.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -440,8 +440,10 @@
 block discarded – undo
440 440
 												echo give_get_payment_note_html( $note, $payment_id );
441 441
 
442 442
 											endforeach;
443
-										else :
443
+										else {
444
+											:
444 445
 											$no_notes_display = '';
446
+										}
445 447
 										endif;
446 448
 										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . __( 'No payment notes', 'give' ) . '</p>';
447 449
 										?>
Please login to merge, or discard this patch.
Spacing   +127 added lines, -127 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
 
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
  * @since 1.0
21 21
  * @return void
22 22
  */
23
-if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
24
-	wp_die( esc_html( 'Donation ID not supplied. Please try again', 'give' ), esc_html( 'Error', 'give' ) );
23
+if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
24
+	wp_die(esc_html('Donation ID not supplied. Please try again', 'give'), esc_html('Error', 'give'));
25 25
 }
26 26
 
27 27
 // Setup the variables
28
-$payment_id = absint( $_GET['id'] );
29
-$payment    = new Give_Payment( $payment_id );
28
+$payment_id = absint($_GET['id']);
29
+$payment    = new Give_Payment($payment_id);
30 30
 
31 31
 // Sanity check... fail if purchase ID is invalid
32 32
 $payment_exists = $payment->ID;
33
-if ( empty( $payment_exists ) ) {
34
-	wp_die( esc_html( 'The specified ID does not belong to a payment. Please try again', 'give' ), esc_html( 'Error', 'give' ) );
33
+if (empty($payment_exists)) {
34
+	wp_die(esc_html('The specified ID does not belong to a payment. Please try again', 'give'), esc_html('Error', 'give'));
35 35
 }
36 36
 
37 37
 $number         = $payment->number;
38 38
 $payment_meta   = $payment->get_meta();
39
-$transaction_id = esc_attr( $payment->transaction_id );
39
+$transaction_id = esc_attr($payment->transaction_id);
40 40
 $user_id        = $payment->user_id;
41 41
 $customer_id    = $payment->customer_id;
42
-$payment_date   = strtotime( $payment->date );
43
-$user_info      = give_get_payment_meta_user_info( $payment_id );
42
+$payment_date   = strtotime($payment->date);
43
+$user_info      = give_get_payment_meta_user_info($payment_id);
44 44
 $address        = $payment->address;
45 45
 $gateway        = $payment->gateway;
46 46
 $currency_code  = $payment->currency;
@@ -52,76 +52,76 @@  discard block
 block discarded – undo
52 52
 	<h1 id="transaction-details-heading"><?php
53 53
 		printf(
54 54
 			/* translators: %s: payment number */
55
-			esc_html( 'Payment %s', 'give' ),
55
+			esc_html('Payment %s', 'give'),
56 56
 			$number
57 57
 		);
58
-		if ( $payment_mode == 'test' ) {
59
-			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr( 'This payment was made in Test Mode', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html( 'Test Payment', 'give' ) . '</span>';
58
+		if ($payment_mode == 'test') {
59
+			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr('This payment was made in Test Mode', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html('Test Payment', 'give').'</span>';
60 60
 		}
61 61
 	?></h1>
62 62
 
63
-	<?php do_action( 'give_view_order_details_before', $payment_id ); ?>
63
+	<?php do_action('give_view_order_details_before', $payment_id); ?>
64 64
 	<form id="give-edit-order-form" method="post">
65
-		<?php do_action( 'give_view_order_details_form_top', $payment_id ); ?>
65
+		<?php do_action('give_view_order_details_form_top', $payment_id); ?>
66 66
 		<div id="poststuff">
67 67
 			<div id="give-dashboard-widgets-wrap">
68 68
 				<div id="post-body" class="metabox-holder columns-2">
69 69
 					<div id="postbox-container-1" class="postbox-container">
70 70
 						<div id="side-sortables" class="meta-box-sortables ui-sortable">
71 71
 
72
-							<?php do_action( 'give_view_order_details_sidebar_before', $payment_id ); ?>
72
+							<?php do_action('give_view_order_details_sidebar_before', $payment_id); ?>
73 73
 
74 74
 
75 75
 							<div id="give-order-update" class="postbox give-order-data">
76 76
 
77 77
 								<h3 class="hndle">
78
-									<span><?php esc_html_e( 'Update Payment', 'give' ); ?></span>
78
+									<span><?php esc_html_e('Update Payment', 'give'); ?></span>
79 79
 								</h3>
80 80
 
81 81
 								<div class="inside">
82 82
 									<div class="give-admin-box">
83 83
 
84
-										<?php do_action( 'give_view_order_details_totals_before', $payment_id ); ?>
84
+										<?php do_action('give_view_order_details_totals_before', $payment_id); ?>
85 85
 
86 86
 										<div class="give-admin-box-inside">
87 87
 											<p>
88
-												<span class="label"><?php esc_html_e( 'Status:', 'give' ); ?></span>&nbsp;
88
+												<span class="label"><?php esc_html_e('Status:', 'give'); ?></span>&nbsp;
89 89
 												<select name="give-payment-status" class="medium-text">
90
-													<?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
91
-														<option value="<?php esc_attr_e( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php esc_html_e( $status ); ?></option>
90
+													<?php foreach (give_get_payment_statuses() as $key => $status) : ?>
91
+														<option value="<?php esc_attr_e($key); ?>"<?php selected($payment->status, $key, true); ?>><?php esc_html_e($status); ?></option>
92 92
 													<?php endforeach; ?>
93 93
 												</select>
94
-												<span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
94
+												<span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>
95 95
 											</p>
96 96
 										</div>
97 97
 
98 98
 										<div class="give-admin-box-inside">
99 99
 											<p>
100
-												<span class="label"><?php esc_html_e( 'Date:', 'give' ); ?></span>&nbsp;
101
-												<input type="text" name="give-payment-date" value="<?php esc_attr_e( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/>
100
+												<span class="label"><?php esc_html_e('Date:', 'give'); ?></span>&nbsp;
101
+												<input type="text" name="give-payment-date" value="<?php esc_attr_e(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/>
102 102
 											</p>
103 103
 										</div>
104 104
 
105 105
 										<div class="give-admin-box-inside">
106 106
 											<p>
107
-												<span class="label"><?php esc_html_e( 'Time:', 'give' ); ?></span>&nbsp;
108
-												<input type="number" step="1" max="24" name="give-payment-time-hour" value="<?php esc_attr_e( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
109
-												<input type="number" step="1" max="59" name="give-payment-time-min" value="<?php esc_attr_e( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>
107
+												<span class="label"><?php esc_html_e('Time:', 'give'); ?></span>&nbsp;
108
+												<input type="number" step="1" max="24" name="give-payment-time-hour" value="<?php esc_attr_e(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
109
+												<input type="number" step="1" max="59" name="give-payment-time-min" value="<?php esc_attr_e(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/>
110 110
 											</p>
111 111
 										</div>
112 112
 
113
-										<?php do_action( 'give_view_order_details_update_inner', $payment_id ); ?>
113
+										<?php do_action('give_view_order_details_update_inner', $payment_id); ?>
114 114
 
115 115
 										<?php
116 116
 										//@TODO: Fees
117
-										$fees = give_get_payment_fees( $payment_id );
118
-										if ( ! empty( $fees ) ) : ?>
117
+										$fees = give_get_payment_fees($payment_id);
118
+										if ( ! empty($fees)) : ?>
119 119
 											<div class="give-order-fees give-admin-box-inside">
120
-												<p class="strong"><?php esc_html_e( 'Fees', 'give' ); ?>:</p>
120
+												<p class="strong"><?php esc_html_e('Fees', 'give'); ?>:</p>
121 121
 												<ul class="give-payment-fees">
122
-													<?php foreach ( $fees as $fee ) : ?>
122
+													<?php foreach ($fees as $fee) : ?>
123 123
 														<li>
124
-															<span class="fee-label"><?php echo $fee['label'] . ':</span> ' . '<span class="fee-amount" data-fee="' . esc_attr( $fee['amount'] ) . '">' . give_currency_filter( $fee['amount'], $currency_code ); ?></span>
124
+															<span class="fee-label"><?php echo $fee['label'].':</span> '.'<span class="fee-amount" data-fee="'.esc_attr($fee['amount']).'">'.give_currency_filter($fee['amount'], $currency_code); ?></span>
125 125
 														</li>
126 126
 													<?php endforeach; ?>
127 127
 												</ul>
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
 
132 132
 										<div class="give-order-payment give-admin-box-inside">
133 133
 											<p>
134
-												<span class="label"><?php esc_html_e( 'Total Donation', 'give' ); ?>:</span>&nbsp;
135
-												<?php echo give_currency_symbol( $payment->currency ); ?>&nbsp;<input name="give-payment-total" type="text" class="small-text give-price-field" value="<?php esc_attr_e( give_format_amount( give_get_payment_amount( $payment_id ) ) ); ?>"/>
134
+												<span class="label"><?php esc_html_e('Total Donation', 'give'); ?>:</span>&nbsp;
135
+												<?php echo give_currency_symbol($payment->currency); ?>&nbsp;<input name="give-payment-total" type="text" class="small-text give-price-field" value="<?php esc_attr_e(give_format_amount(give_get_payment_amount($payment_id))); ?>"/>
136 136
 											</p>
137 137
 										</div>
138 138
 
139
-										<?php do_action( 'give_view_order_details_totals_after', $payment_id ); ?>
139
+										<?php do_action('give_view_order_details_totals_after', $payment_id); ?>
140 140
 
141 141
 									</div>
142 142
 									<!-- /.give-admin-box -->
@@ -145,20 +145,20 @@  discard block
 block discarded – undo
145 145
 								<!-- /.inside -->
146 146
 
147 147
 								<div class="give-order-update-box give-admin-box">
148
-									<?php do_action( 'give_view_order_details_update_before', $payment_id ); ?>
148
+									<?php do_action('give_view_order_details_update_before', $payment_id); ?>
149 149
 									<div id="major-publishing-actions">
150 150
 										<div id="publishing-action">
151
-											<input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Payment', 'give' ); ?>"/>
152
-											<?php if ( give_is_payment_complete( $payment_id ) ) : ?>
153
-												<a href="<?php echo esc_url( add_query_arg( array(
151
+											<input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Payment', 'give'); ?>"/>
152
+											<?php if (give_is_payment_complete($payment_id)) : ?>
153
+												<a href="<?php echo esc_url(add_query_arg(array(
154 154
 													'give-action' => 'email_links',
155 155
 													'purchase_id' => $payment_id
156
-												) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a>
156
+												))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a>
157 157
 											<?php endif; ?>
158 158
 										</div>
159 159
 										<div class="clear"></div>
160 160
 									</div>
161
-									<?php do_action( 'give_view_order_details_update_after', $payment_id ); ?>
161
+									<?php do_action('give_view_order_details_update_after', $payment_id); ?>
162 162
 								</div>
163 163
 								<!-- /.give-order-update-box -->
164 164
 
@@ -168,55 +168,55 @@  discard block
 block discarded – undo
168 168
 							<div id="give-order-details" class="postbox give-order-data">
169 169
 
170 170
 								<h3 class="hndle">
171
-									<span><?php esc_html_e( 'Payment Meta', 'give' ); ?></span>
171
+									<span><?php esc_html_e('Payment Meta', 'give'); ?></span>
172 172
 								</h3>
173 173
 
174 174
 								<div class="inside">
175 175
 									<div class="give-admin-box">
176 176
 
177
-										<?php do_action( 'give_view_order_details_payment_meta_before', $payment_id ); ?>
177
+										<?php do_action('give_view_order_details_payment_meta_before', $payment_id); ?>
178 178
 
179 179
 										<?php
180
-										$gateway = give_get_payment_gateway( $payment_id );
181
-										if ( $gateway ) : ?>
180
+										$gateway = give_get_payment_gateway($payment_id);
181
+										if ($gateway) : ?>
182 182
 											<div class="give-order-gateway give-admin-box-inside">
183 183
 												<p>
184
-													<span class="label"><?php esc_html_e( 'Gateway:', 'give' ); ?></span>&nbsp;
185
-													<?php echo give_get_gateway_admin_label( $gateway ); ?>
184
+													<span class="label"><?php esc_html_e('Gateway:', 'give'); ?></span>&nbsp;
185
+													<?php echo give_get_gateway_admin_label($gateway); ?>
186 186
 												</p>
187 187
 											</div>
188 188
 										<?php endif; ?>
189 189
 
190 190
 										<div class="give-order-payment-key give-admin-box-inside">
191 191
 											<p>
192
-												<span class="label"><?php esc_html_e( 'Key:', 'give' ); ?></span>&nbsp;
193
-												<span><?php echo give_get_payment_key( $payment_id ); ?></span>
192
+												<span class="label"><?php esc_html_e('Key:', 'give'); ?></span>&nbsp;
193
+												<span><?php echo give_get_payment_key($payment_id); ?></span>
194 194
 											</p>
195 195
 										</div>
196 196
 
197 197
 										<div class="give-order-ip give-admin-box-inside">
198 198
 											<p>
199
-												<span class="label"><?php esc_html_e( 'IP:', 'give' ); ?></span>&nbsp;
200
-												<span><?php esc_html_e( give_get_payment_user_ip( $payment_id ) ); ?></span>
199
+												<span class="label"><?php esc_html_e('IP:', 'give'); ?></span>&nbsp;
200
+												<span><?php esc_html_e(give_get_payment_user_ip($payment_id)); ?></span>
201 201
 											</p>
202 202
 										</div>
203 203
 
204
-										<?php if ( $transaction_id ) : ?>
204
+										<?php if ($transaction_id) : ?>
205 205
 											<div class="give-order-tx-id give-admin-box-inside">
206 206
 												<p>
207
-													<span class="label"><?php esc_html_e( 'Transaction ID:', 'give' ); ?></span>&nbsp;
208
-													<span><?php echo apply_filters( 'give_payment_details_transaction_id-' . $gateway, $transaction_id, $payment_id ); ?></span>
207
+													<span class="label"><?php esc_html_e('Transaction ID:', 'give'); ?></span>&nbsp;
208
+													<span><?php echo apply_filters('give_payment_details_transaction_id-'.$gateway, $transaction_id, $payment_id); ?></span>
209 209
 												</p>
210 210
 											</div>
211 211
 										<?php endif; ?>
212 212
 
213 213
 										<div class="give-admin-box-inside">
214
-											<p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . esc_attr( give_get_payment_user_email( $payment_id ) ) ); ?>
215
-												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor', 'give' ); ?> &raquo;</a>
214
+											<p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.esc_attr(give_get_payment_user_email($payment_id))); ?>
215
+												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor', 'give'); ?> &raquo;</a>
216 216
 											</p>
217 217
 										</div>
218 218
 
219
-										<?php do_action( 'give_view_order_details_payment_meta_after', $payment_id ); ?>
219
+										<?php do_action('give_view_order_details_payment_meta_after', $payment_id); ?>
220 220
 
221 221
 									</div>
222 222
 									<!-- /.column-container -->
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 							</div>
228 228
 							<!-- /#give-order-data -->
229 229
 
230
-							<?php do_action( 'give_view_order_details_sidebar_after', $payment_id ); ?>
230
+							<?php do_action('give_view_order_details_sidebar_after', $payment_id); ?>
231 231
 
232 232
 						</div>
233 233
 						<!-- /#side-sortables -->
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 
239 239
 						<div id="normal-sortables" class="meta-box-sortables ui-sortable">
240 240
 
241
-							<?php do_action( 'give_view_order_details_main_before', $payment_id ); ?>
241
+							<?php do_action('give_view_order_details_main_before', $payment_id); ?>
242 242
 
243 243
 							<?php $column_count = 'columns-3'; ?>
244 244
 							<div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
245 245
 								<h3 class="hndle">
246
-									<span><?php esc_html_e( 'Donation Information', 'give' ); ?></span>
246
+									<span><?php esc_html_e('Donation Information', 'give'); ?></span>
247 247
 								</h3>
248 248
 
249 249
 								<div class="inside">
@@ -251,29 +251,29 @@  discard block
 block discarded – undo
251 251
 									<table style="width:100%;text-align:left;">
252 252
 										<thead>
253 253
 										<tr>
254
-											<?php do_action( 'give_donation_details_thead_before', $payment_id ); ?>
255
-											<th><?php esc_html_e( 'Donation Form ID', 'give' ) ?></th>
256
-											<th><?php esc_html_e( 'Donation Form Title', 'give' ) ?></th>
257
-											<th><?php esc_html_e( 'Donation Level', 'give' ) ?></th>
258
-											<th><?php esc_html_e( 'Donation Date', 'give' ) ?></th>
259
-											<th><?php esc_html_e( 'Total Donation', 'give' ) ?></th>
260
-											<?php do_action( 'give_donation_details_thead_after', $payment_id ); ?>
254
+											<?php do_action('give_donation_details_thead_before', $payment_id); ?>
255
+											<th><?php esc_html_e('Donation Form ID', 'give') ?></th>
256
+											<th><?php esc_html_e('Donation Form Title', 'give') ?></th>
257
+											<th><?php esc_html_e('Donation Level', 'give') ?></th>
258
+											<th><?php esc_html_e('Donation Date', 'give') ?></th>
259
+											<th><?php esc_html_e('Total Donation', 'give') ?></th>
260
+											<?php do_action('give_donation_details_thead_after', $payment_id); ?>
261 261
 										</tr>
262 262
 										</thead>
263 263
 										<tr>
264
-											<?php do_action( 'give_donation_details_tbody_before', $payment_id ); ?>
264
+											<?php do_action('give_donation_details_tbody_before', $payment_id); ?>
265 265
 											<td>
266 266
 												<?php echo $payment_meta['form_id']; ?>
267 267
 											</td>
268 268
 											<td>
269
-												<a href="<?php echo get_permalink( $payment_meta['form_id'] ); ?>"><?php echo $payment_meta['form_title']; ?></a>
269
+												<a href="<?php echo get_permalink($payment_meta['form_id']); ?>"><?php echo $payment_meta['form_title']; ?></a>
270 270
 											</td>
271 271
 											<td>
272 272
 												<?php
273 273
 												//Level ID
274
-												$level_title = give_get_payment_form_title( $payment_meta, true );
275
-												if ( empty( $level_title ) ) {
276
-													esc_html_e( 'n/a', 'give' );
274
+												$level_title = give_get_payment_form_title($payment_meta, true);
275
+												if (empty($level_title)) {
276
+													esc_html_e('n/a', 'give');
277 277
 												} else {
278 278
 													echo $level_title;
279 279
 												} ?>
@@ -281,13 +281,13 @@  discard block
 block discarded – undo
281 281
 											<td>
282 282
 												<?php
283 283
 												//Transaction Date
284
-												$date_format = get_option( 'date_format' );
285
-												echo date_i18n( $date_format, strtotime( $payment_date ) );
284
+												$date_format = get_option('date_format');
285
+												echo date_i18n($date_format, strtotime($payment_date));
286 286
 												?>
287 287
 											</td>
288 288
 											<td>
289
-												<?php esc_html_e( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?></td>
290
-											<?php do_action( 'give_donation_details_tbody_after', $payment_id ); ?>
289
+												<?php esc_html_e(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?></td>
290
+											<?php do_action('give_donation_details_tbody_after', $payment_id); ?>
291 291
 
292 292
 										</tr>
293 293
 									</table>
@@ -299,64 +299,64 @@  discard block
 block discarded – undo
299 299
 							</div>
300 300
 							<!-- /#give-donation-overview -->
301 301
 
302
-							<?php do_action( 'give_view_order_details_files_after', $payment_id ); ?>
302
+							<?php do_action('give_view_order_details_files_after', $payment_id); ?>
303 303
 
304
-							<?php do_action( 'give_view_order_details_billing_before', $payment_id ); ?>
304
+							<?php do_action('give_view_order_details_billing_before', $payment_id); ?>
305 305
 
306 306
 
307 307
 							<div id="give-customer-details" class="postbox">
308 308
 								<h3 class="hndle">
309
-									<span><?php esc_html_e( 'Donor Details', 'give' ); ?></span>
309
+									<span><?php esc_html_e('Donor Details', 'give'); ?></span>
310 310
 								</h3>
311 311
 
312 312
 								<div class="inside give-clearfix">
313 313
 
314
-									<?php $customer = new Give_Customer( $customer_id ); ?>
314
+									<?php $customer = new Give_Customer($customer_id); ?>
315 315
 
316 316
 									<div class="column-container customer-info">
317 317
 										<div class="column">
318
-											<?php echo Give()->html->donor_dropdown( array(
318
+											<?php echo Give()->html->donor_dropdown(array(
319 319
 												'selected' => $customer->id,
320 320
 												'name'     => 'customer-id'
321
-											) ); ?>
321
+											)); ?>
322 322
 										</div>
323 323
 										<div class="column">
324 324
 											<input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/>
325 325
 										</div>
326 326
 										<div class="column">
327
-											<?php if ( ! empty( $customer->id ) ) : ?>
328
-												<?php $customer_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>
329
-												<a href="<?php echo $customer_url; ?>" title="<?php esc_attr_e( 'View Donor Details', 'give' ); ?>"><?php esc_html_e( 'View Donor Details', 'give' ); ?></a>
327
+											<?php if ( ! empty($customer->id)) : ?>
328
+												<?php $customer_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?>
329
+												<a href="<?php echo $customer_url; ?>" title="<?php esc_attr_e('View Donor Details', 'give'); ?>"><?php esc_html_e('View Donor Details', 'give'); ?></a>
330 330
 												&nbsp;|&nbsp;
331 331
 											<?php endif; ?>
332
-											<a href="#new" class="give-payment-new-customer" title="<?php esc_attr_e( 'New Donor', 'give' ); ?>"><?php esc_html_e( 'New Donor', 'give' ); ?></a>
332
+											<a href="#new" class="give-payment-new-customer" title="<?php esc_attr_e('New Donor', 'give'); ?>"><?php esc_html_e('New Donor', 'give'); ?></a>
333 333
 										</div>
334 334
 									</div>
335 335
 
336 336
 									<div class="column-container new-customer" style="display: none">
337 337
 										<div class="column">
338
-											<strong><?php esc_html_e( 'Name:', 'give' ); ?></strong>&nbsp;
338
+											<strong><?php esc_html_e('Name:', 'give'); ?></strong>&nbsp;
339 339
 											<input type="text" name="give-new-customer-name" value="" class="medium-text"/>
340 340
 										</div>
341 341
 										<div class="column">
342
-											<strong><?php esc_html_e( 'Email:', 'give' ); ?></strong>&nbsp;
342
+											<strong><?php esc_html_e('Email:', 'give'); ?></strong>&nbsp;
343 343
 											<input type="email" name="give-new-customer-email" value="" class="medium-text"/>
344 344
 										</div>
345 345
 										<div class="column">
346 346
 											<input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/>
347
-											<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
347
+											<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a>
348 348
 										</div>
349 349
 										<div class="column">
350 350
 											<small>
351
-												<em>*<?php esc_html_e( 'Click "Save Payment" to create new donor', 'give' ); ?></em>
351
+												<em>*<?php esc_html_e('Click "Save Payment" to create new donor', 'give'); ?></em>
352 352
 											</small>
353 353
 										</div>
354 354
 									</div>
355 355
 
356 356
 									<?php
357 357
 									// The give_payment_personal_details_list hook is left here for backwards compatibility
358
-									do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
359
-									do_action( 'give_payment_view_details', $payment_id );
358
+									do_action('give_payment_personal_details_list', $payment_meta, $user_info);
359
+									do_action('give_payment_view_details', $payment_id);
360 360
 									?>
361 361
 
362 362
 								</div>
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 
368 368
 							<div id="give-billing-details" class="postbox">
369 369
 								<h3 class="hndle">
370
-									<span><?php esc_html_e( 'Billing Address', 'give' ); ?></span>
370
+									<span><?php esc_html_e('Billing Address', 'give'); ?></span>
371 371
 								</h3>
372 372
 
373 373
 								<div class="inside give-clearfix">
@@ -378,62 +378,62 @@  discard block
 block discarded – undo
378 378
 											<div class="data column-container">
379 379
 												<div class="column">
380 380
 													<p>
381
-														<strong class="order-data-address-line"><?php esc_html_e( 'Street Address Line 1:', 'give' ); ?></strong><br/>
382
-														<input type="text" name="give-payment-address[0][line1]" value="<?php esc_attr_e( $address['line1'] ); ?>" class="medium-text"/>
381
+														<strong class="order-data-address-line"><?php esc_html_e('Street Address Line 1:', 'give'); ?></strong><br/>
382
+														<input type="text" name="give-payment-address[0][line1]" value="<?php esc_attr_e($address['line1']); ?>" class="medium-text"/>
383 383
 													</p>
384 384
 
385 385
 													<p>
386
-														<strong class="order-data-address-line"><?php esc_html_e( 'Street Address Line 2:', 'give' ); ?></strong><br/>
387
-														<input type="text" name="give-payment-address[0][line2]" value="<?php esc_attr_e( $address['line2'] ); ?>" class="medium-text"/>
386
+														<strong class="order-data-address-line"><?php esc_html_e('Street Address Line 2:', 'give'); ?></strong><br/>
387
+														<input type="text" name="give-payment-address[0][line2]" value="<?php esc_attr_e($address['line2']); ?>" class="medium-text"/>
388 388
 													</p>
389 389
 
390 390
 												</div>
391 391
 												<div class="column">
392 392
 													<p>
393
-														<strong class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></strong><br/>
394
-														<input type="text" name="give-payment-address[0][city]" value="<?php esc_attr_e( $address['city'] ); ?>" class="medium-text"/>
393
+														<strong class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></strong><br/>
394
+														<input type="text" name="give-payment-address[0][city]" value="<?php esc_attr_e($address['city']); ?>" class="medium-text"/>
395 395
 
396 396
 													</p>
397 397
 
398 398
 													<p>
399
-														<strong class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></strong><br/>
400
-														<input type="text" name="give-payment-address[0][zip]" value="<?php esc_attr_e( $address['zip'] ); ?>" class="medium-text"/>
399
+														<strong class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></strong><br/>
400
+														<input type="text" name="give-payment-address[0][zip]" value="<?php esc_attr_e($address['zip']); ?>" class="medium-text"/>
401 401
 
402 402
 													</p>
403 403
 												</div>
404 404
 												<div class="column">
405 405
 													<p id="give-order-address-country-wrap">
406
-														<strong class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></strong><br/>
406
+														<strong class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></strong><br/>
407 407
 														<?php
408
-														echo Give()->html->select( array(
408
+														echo Give()->html->select(array(
409 409
 															'options'          => give_get_country_list(),
410 410
 															'name'             => 'give-payment-address[0][country]',
411 411
 															'selected'         => $address['country'],
412 412
 															'show_option_all'  => false,
413 413
 															'show_option_none' => false,
414 414
 															'chosen'           => true,
415
-															'placeholder'      => esc_attr( 'Select a country', 'give' )
416
-														) );
415
+															'placeholder'      => esc_attr('Select a country', 'give')
416
+														));
417 417
 														?>
418 418
 													</p>
419 419
 
420 420
 													<p id="give-order-address-state-wrap">
421
-														<strong class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></strong><br/>
421
+														<strong class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></strong><br/>
422 422
 														<?php
423
-														$states = give_get_states( $address['country'] );
424
-														if ( ! empty( $states ) ) {
425
-															echo Give()->html->select( array(
423
+														$states = give_get_states($address['country']);
424
+														if ( ! empty($states)) {
425
+															echo Give()->html->select(array(
426 426
 																'options'          => $states,
427 427
 																'name'             => 'give-payment-address[0][state]',
428 428
 																'selected'         => $address['state'],
429 429
 																'show_option_all'  => false,
430 430
 																'show_option_none' => false,
431 431
 																'chosen'           => true,
432
-																'placeholder'      => esc_attr( 'Select a state', 'give' )
433
-															) );
432
+																'placeholder'      => esc_attr('Select a state', 'give')
433
+															));
434 434
 														} else {
435 435
 															?>
436
-															<input type="text" name="give-payment-address[0][state]" value="<?php esc_attr_e( $address['state'] ); ?>" class="medium-text"/>
436
+															<input type="text" name="give-payment-address[0][state]" value="<?php esc_attr_e($address['state']); ?>" class="medium-text"/>
437 437
 															<?php
438 438
 														} ?>
439 439
 													</p>
@@ -443,39 +443,39 @@  discard block
 block discarded – undo
443 443
 									</div>
444 444
 									<!-- /#give-order-address -->
445 445
 
446
-									<?php do_action( 'give_payment_billing_details', $payment_id ); ?>
446
+									<?php do_action('give_payment_billing_details', $payment_id); ?>
447 447
 
448 448
 								</div>
449 449
 								<!-- /.inside -->
450 450
 							</div>
451 451
 							<!-- /#give-billing-details -->
452 452
 
453
-							<?php do_action( 'give_view_order_details_billing_after', $payment_id ); ?>
453
+							<?php do_action('give_view_order_details_billing_after', $payment_id); ?>
454 454
 
455 455
 							<div id="give-payment-notes" class="postbox">
456
-								<h3 class="hndle"><span><?php esc_html_e( 'Payment Notes', 'give' ); ?></span></h3>
456
+								<h3 class="hndle"><span><?php esc_html_e('Payment Notes', 'give'); ?></span></h3>
457 457
 
458 458
 								<div class="inside">
459 459
 									<div id="give-payment-notes-inner">
460 460
 										<?php
461
-										$notes = give_get_payment_notes( $payment_id );
462
-										if ( ! empty( $notes ) ) :
461
+										$notes = give_get_payment_notes($payment_id);
462
+										if ( ! empty($notes)) :
463 463
 											$no_notes_display = ' style="display:none;"';
464
-											foreach ( $notes as $note ) :
464
+											foreach ($notes as $note) :
465 465
 
466
-												echo give_get_payment_note_html( $note, $payment_id );
466
+												echo give_get_payment_note_html($note, $payment_id);
467 467
 
468 468
 											endforeach;
469 469
 										else :
470 470
 											$no_notes_display = '';
471 471
 										endif;
472
-										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html( 'No payment notes', 'give' ) . '</p>';
472
+										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html('No payment notes', 'give').'</p>';
473 473
 										?>
474 474
 									</div>
475 475
 									<textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
476 476
 
477 477
 									<p class="give-clearfix">
478
-										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button>
478
+										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button>
479 479
 									</p>
480 480
 
481 481
 									<div class="clear"></div>
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 							</div>
485 485
 							<!-- /#give-payment-notes -->
486 486
 
487
-							<?php do_action( 'give_view_order_details_main_after', $payment_id ); ?>
487
+							<?php do_action('give_view_order_details_main_after', $payment_id); ?>
488 488
 						</div>
489 489
 						<!-- /#normal-sortables -->
490 490
 					</div>
@@ -495,10 +495,10 @@  discard block
 block discarded – undo
495 495
 			<!-- #give-dashboard-widgets-wrap -->
496 496
 		</div>
497 497
 		<!-- /#post-stuff -->
498
-		<?php do_action( 'give_view_order_details_form_bottom', $payment_id ); ?>
499
-		<?php wp_nonce_field( 'give_update_payment_details_nonce' ); ?>
500
-		<input type="hidden" name="give_payment_id" value="<?php esc_attr_e( $payment_id ); ?>"/>
498
+		<?php do_action('give_view_order_details_form_bottom', $payment_id); ?>
499
+		<?php wp_nonce_field('give_update_payment_details_nonce'); ?>
500
+		<input type="hidden" name="give_payment_id" value="<?php esc_attr_e($payment_id); ?>"/>
501 501
 		<input type="hidden" name="give_action" value="update_payment_details"/>
502 502
 	</form>
503
-	<?php do_action( 'give_view_order_details_after', $payment_id ); ?>
503
+	<?php do_action('give_view_order_details_after', $payment_id); ?>
504 504
 </div><!-- /.wrap -->
Please login to merge, or discard this patch.