Completed
Pull Request — master (#1619)
by Ravinder
17:48
created
includes/payments/class-give-payment.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 *
393 393
 	 * @param  int|bool $payment_id A given payment
394 394
 	 *
395
-	 * @return mixed void|false
395
+	 * @return false|null void|false
396 396
 	 */
397 397
 	public function __construct( $payment_id = false ) {
398 398
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	 *
464 464
 	 * @param  string $name The attribute to get
465 465
 	 *
466
-	 * @return boolean       If the item is set or not
466
+	 * @return boolean|null       If the item is set or not
467 467
 	 */
468 468
 	public function __isset( $name ) {
469 469
 		if ( property_exists( $this, $name ) ) {
@@ -1302,7 +1302,7 @@  discard block
 block discarded – undo
1302 1302
 	 *
1303 1303
 	 * @param  string $note The note to add
1304 1304
 	 *
1305
-	 * @return void
1305
+	 * @return false|null
1306 1306
 	 */
1307 1307
 	public function add_note( $note = false ) {
1308 1308
 		// Bail if no note specified.
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1050,7 +1050,7 @@
 block discarded – undo
1050 1050
 					// Find a match between price_id and level_id.
1051 1051
 					// First verify array keys exists THEN make the match.
1052 1052
 					if ( ( isset( $args['price_id'] ) && isset( $price['_give_id']['level_id'] ) )
1053
-					     && $args['price_id'] == $price['_give_id']['level_id']
1053
+						 && $args['price_id'] == $price['_give_id']['level_id']
1054 1054
 					) {
1055 1055
 						$item_price = $price['_give_amount'];
1056 1056
 					}
Please login to merge, or discard this patch.
Spacing   +326 added lines, -326 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
 
@@ -394,13 +394,13 @@  discard block
 block discarded – undo
394 394
 	 *
395 395
 	 * @return mixed void|false
396 396
 	 */
397
-	public function __construct( $payment_id = false ) {
397
+	public function __construct($payment_id = false) {
398 398
 
399
-		if ( empty( $payment_id ) ) {
399
+		if (empty($payment_id)) {
400 400
 			return false;
401 401
 		}
402 402
 
403
-		$this->setup_payment( $payment_id );
403
+		$this->setup_payment($payment_id);
404 404
 	}
405 405
 
406 406
 	/**
@@ -413,11 +413,11 @@  discard block
 block discarded – undo
413 413
 	 *
414 414
 	 * @return mixed        The value.
415 415
 	 */
416
-	public function __get( $key ) {
416
+	public function __get($key) {
417 417
 
418
-		if ( method_exists( $this, 'get_' . $key ) ) {
418
+		if (method_exists($this, 'get_'.$key)) {
419 419
 
420
-			$value = call_user_func( array( $this, 'get_' . $key ) );
420
+			$value = call_user_func(array($this, 'get_'.$key));
421 421
 
422 422
 		} else {
423 423
 
@@ -439,18 +439,18 @@  discard block
 block discarded – undo
439 439
 	 * @param  string $key   The property name
440 440
 	 * @param  mixed  $value The value of the property
441 441
 	 */
442
-	public function __set( $key, $value ) {
443
-		$ignore = array( '_ID' );
442
+	public function __set($key, $value) {
443
+		$ignore = array('_ID');
444 444
 
445
-		if ( $key === 'status' ) {
445
+		if ($key === 'status') {
446 446
 			$this->old_status = $this->status;
447 447
 		}
448 448
 
449
-		if ( ! in_array( $key, $ignore ) ) {
450
-			$this->pending[ $key ] = $value;
449
+		if ( ! in_array($key, $ignore)) {
450
+			$this->pending[$key] = $value;
451 451
 		}
452 452
 
453
-		if ( '_ID' !== $key ) {
453
+		if ('_ID' !== $key) {
454 454
 			$this->$key = $value;
455 455
 		}
456 456
 	}
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
 	 *
466 466
 	 * @return boolean       If the item is set or not
467 467
 	 */
468
-	public function __isset( $name ) {
469
-		if ( property_exists( $this, $name ) ) {
470
-			return false === empty( $this->$name );
468
+	public function __isset($name) {
469
+		if (property_exists($this, $name)) {
470
+			return false === empty($this->$name);
471 471
 		} else {
472 472
 			return null;
473 473
 		}
@@ -483,20 +483,20 @@  discard block
 block discarded – undo
483 483
 	 *
484 484
 	 * @return bool            If the setup was successful or not
485 485
 	 */
486
-	private function setup_payment( $payment_id ) {
486
+	private function setup_payment($payment_id) {
487 487
 		$this->pending = array();
488 488
 
489
-		if ( empty( $payment_id ) ) {
489
+		if (empty($payment_id)) {
490 490
 			return false;
491 491
 		}
492 492
 
493
-		$payment = get_post( $payment_id );
493
+		$payment = get_post($payment_id);
494 494
 
495
-		if ( ! $payment || is_wp_error( $payment ) ) {
495
+		if ( ! $payment || is_wp_error($payment)) {
496 496
 			return false;
497 497
 		}
498 498
 
499
-		if ( 'give_payment' !== $payment->post_type ) {
499
+		if ('give_payment' !== $payment->post_type) {
500 500
 			return false;
501 501
 		}
502 502
 
@@ -510,13 +510,13 @@  discard block
 block discarded – undo
510 510
 		 * @param Give_Payment $this       Payment object.
511 511
 		 * @param int          $payment_id The ID of the payment.
512 512
 		 */
513
-		do_action( 'give_pre_setup_payment', $this, $payment_id );
513
+		do_action('give_pre_setup_payment', $this, $payment_id);
514 514
 
515 515
 		// Primary Identifier.
516
-		$this->ID = absint( $payment_id );
516
+		$this->ID = absint($payment_id);
517 517
 
518 518
 		// Protected ID that can never be changed.
519
-		$this->_ID = absint( $payment_id );
519
+		$this->_ID = absint($payment_id);
520 520
 
521 521
 		// We have a payment, get the generic payment_meta item to reduce calls to it.
522 522
 		$this->payment_meta = $this->get_meta();
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 		$this->parent_payment = $payment->post_parent;
532 532
 
533 533
 		$all_payment_statuses  = give_get_payment_statuses();
534
-		$this->status_nicename = array_key_exists( $this->status, $all_payment_statuses ) ? $all_payment_statuses[ $this->status ] : ucfirst( $this->status );
534
+		$this->status_nicename = array_key_exists($this->status, $all_payment_statuses) ? $all_payment_statuses[$this->status] : ucfirst($this->status);
535 535
 
536 536
 		// Items.
537 537
 		$this->fees = $this->setup_fees();
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 		 * @param Give_Payment $this       Payment object.
574 574
 		 * @param int          $payment_id The ID of the payment.
575 575
 		 */
576
-		do_action( 'give_setup_payment', $this, $payment_id );
576
+		do_action('give_setup_payment', $this, $payment_id);
577 577
 
578 578
 		return true;
579 579
 	}
@@ -591,8 +591,8 @@  discard block
 block discarded – undo
591 591
 	 *
592 592
 	 * @return void
593 593
 	 */
594
-	public function update_payment_setup( $payment_id ) {
595
-		$this->setup_payment( $payment_id );
594
+	public function update_payment_setup($payment_id) {
595
+		$this->setup_payment($payment_id);
596 596
 	}
597 597
 
598 598
 	/**
@@ -607,24 +607,24 @@  discard block
 block discarded – undo
607 607
 
608 608
 		// Construct the payment title.
609 609
 		$payment_title = '';
610
-		if ( ! empty( $this->first_name ) && ! empty( $this->last_name ) ) {
611
-			$payment_title = $this->first_name . ' ' . $this->last_name;
612
-		} elseif ( ! empty( $this->first_name ) && empty( $this->last_name ) ) {
610
+		if ( ! empty($this->first_name) && ! empty($this->last_name)) {
611
+			$payment_title = $this->first_name.' '.$this->last_name;
612
+		} elseif ( ! empty($this->first_name) && empty($this->last_name)) {
613 613
 			$payment_title = $this->first_name;
614
-		} elseif ( ! empty( $this->email ) && is_email( $this->email ) ) {
614
+		} elseif ( ! empty($this->email) && is_email($this->email)) {
615 615
 			$payment_title = $this->email;
616 616
 		}
617 617
 
618 618
 		// Set Key.
619
-		if ( empty( $this->key ) ) {
619
+		if (empty($this->key)) {
620 620
 
621
-			$auth_key             = defined( 'AUTH_KEY' ) ? AUTH_KEY : '';
622
-			$this->key            = strtolower( md5( $this->email . date( 'Y-m-d H:i:s' ) . $auth_key . uniqid( 'give', true ) ) );  // Unique key
621
+			$auth_key             = defined('AUTH_KEY') ? AUTH_KEY : '';
622
+			$this->key            = strtolower(md5($this->email.date('Y-m-d H:i:s').$auth_key.uniqid('give', true))); // Unique key
623 623
 			$this->pending['key'] = $this->key;
624 624
 		}
625 625
 
626 626
 		// Set IP.
627
-		if ( empty( $this->ip ) ) {
627
+		if (empty($this->ip)) {
628 628
 
629 629
 			$this->ip            = give_get_ip();
630 630
 			$this->pending['ip'] = $this->ip;
@@ -651,63 +651,63 @@  discard block
 block discarded – undo
651 651
 			'fees'         => $this->fees,
652 652
 		);
653 653
 
654
-		$args = apply_filters( 'give_insert_payment_args', array(
654
+		$args = apply_filters('give_insert_payment_args', array(
655 655
 			'post_title'    => $payment_title,
656 656
 			'post_status'   => $this->status,
657 657
 			'post_type'     => 'give_payment',
658
-			'post_date'     => ! empty( $this->date ) ? $this->date : null,
659
-			'post_date_gmt' => ! empty( $this->date ) ? get_gmt_from_date( $this->date ) : null,
658
+			'post_date'     => ! empty($this->date) ? $this->date : null,
659
+			'post_date_gmt' => ! empty($this->date) ? get_gmt_from_date($this->date) : null,
660 660
 			'post_parent'   => $this->parent_payment,
661
-		), $payment_data );
661
+		), $payment_data);
662 662
 
663 663
 		// Create a blank payment
664
-		$payment_id = wp_insert_post( $args );
664
+		$payment_id = wp_insert_post($args);
665 665
 
666
-		if ( ! empty( $payment_id ) ) {
666
+		if ( ! empty($payment_id)) {
667 667
 
668 668
 			$this->ID  = $payment_id;
669 669
 			$this->_ID = $payment_id;
670 670
 
671 671
 			$customer = new stdClass;
672 672
 
673
-			if ( did_action( 'give_pre_process_donation' ) && is_user_logged_in() ) {
674
-				$customer = new Give_Customer( get_current_user_id(), true );
673
+			if (did_action('give_pre_process_donation') && is_user_logged_in()) {
674
+				$customer = new Give_Customer(get_current_user_id(), true);
675 675
 
676 676
 				// Customer is logged in but used a different email to purchase with so assign to their customer record
677
-				if ( ! empty( $customer->id ) && $this->email != $customer->email ) {
678
-					$customer->add_email( $this->email );
677
+				if ( ! empty($customer->id) && $this->email != $customer->email) {
678
+					$customer->add_email($this->email);
679 679
 				}
680 680
 			}
681 681
 
682
-			if ( empty( $customer->id ) ) {
683
-				$customer = new Give_Customer( $this->email );
682
+			if (empty($customer->id)) {
683
+				$customer = new Give_Customer($this->email);
684 684
 			}
685 685
 
686
-			if ( empty( $customer->id ) ) {
686
+			if (empty($customer->id)) {
687 687
 
688 688
 				$customer_data = array(
689
-					'name'    => ! is_email( $payment_title ) ? $this->first_name . ' ' . $this->last_name : '',
689
+					'name'    => ! is_email($payment_title) ? $this->first_name.' '.$this->last_name : '',
690 690
 					'email'   => $this->email,
691 691
 					'user_id' => $this->user_id,
692 692
 				);
693 693
 
694
-				$customer->create( $customer_data );
694
+				$customer->create($customer_data);
695 695
 
696 696
 			}
697 697
 
698 698
 			$this->customer_id            = $customer->id;
699 699
 			$this->pending['customer_id'] = $this->customer_id;
700
-			$customer->attach_payment( $this->ID, false );
700
+			$customer->attach_payment($this->ID, false);
701 701
 
702
-			$this->payment_meta = apply_filters( 'give_payment_meta', $this->payment_meta, $payment_data );
703
-			if ( ! empty( $this->payment_meta['fees'] ) ) {
704
-				$this->fees = array_merge( $this->fees, $this->payment_meta['fees'] );
705
-				foreach ( $this->fees as $fee ) {
706
-					$this->increase_fees( $fee['amount'] );
702
+			$this->payment_meta = apply_filters('give_payment_meta', $this->payment_meta, $payment_data);
703
+			if ( ! empty($this->payment_meta['fees'])) {
704
+				$this->fees = array_merge($this->fees, $this->payment_meta['fees']);
705
+				foreach ($this->fees as $fee) {
706
+					$this->increase_fees($fee['amount']);
707 707
 				}
708 708
 			}
709 709
 
710
-			$this->update_meta( '_give_payment_meta', $this->payment_meta );
710
+			$this->update_meta('_give_payment_meta', $this->payment_meta);
711 711
 			$this->new = true;
712 712
 		}
713 713
 
@@ -729,11 +729,11 @@  discard block
 block discarded – undo
729 729
 		$saved = false;
730 730
 
731 731
 		// Must have an ID.
732
-		if ( empty( $this->ID ) ) {
732
+		if (empty($this->ID)) {
733 733
 
734 734
 			$payment_id = $this->insert_payment();
735 735
 
736
-			if ( false === $payment_id ) {
736
+			if (false === $payment_id) {
737 737
 				$saved = false;
738 738
 			} else {
739 739
 				$this->ID = $payment_id;
@@ -741,48 +741,48 @@  discard block
 block discarded – undo
741 741
 		}
742 742
 
743 743
 		// Set ID if not matching.
744
-		if ( $this->ID !== $this->_ID ) {
744
+		if ($this->ID !== $this->_ID) {
745 745
 			$this->ID = $this->_ID;
746 746
 		}
747 747
 
748 748
 		// If we have something pending, let's save it.
749
-		if ( ! empty( $this->pending ) ) {
749
+		if ( ! empty($this->pending)) {
750 750
 
751 751
 			$total_increase = 0;
752 752
 			$total_decrease = 0;
753 753
 
754
-			foreach ( $this->pending as $key => $value ) {
754
+			foreach ($this->pending as $key => $value) {
755 755
 
756
-				switch ( $key ) {
756
+				switch ($key) {
757 757
 
758 758
 					case 'donations':
759 759
 						// Update totals for pending donations.
760
-						foreach ( $this->pending[ $key ] as $item ) {
760
+						foreach ($this->pending[$key] as $item) {
761 761
 
762
-							$quantity = isset( $item['quantity'] ) ? $item['quantity'] : 1;
763
-							$price_id = isset( $item['price_id'] ) ? $item['price_id'] : 0;
762
+							$quantity = isset($item['quantity']) ? $item['quantity'] : 1;
763
+							$price_id = isset($item['price_id']) ? $item['price_id'] : 0;
764 764
 
765
-							switch ( $item['action'] ) {
765
+							switch ($item['action']) {
766 766
 
767 767
 								case 'add':
768 768
 
769 769
 									$price = $item['price'];
770 770
 
771
-									if ( 'publish' === $this->status || 'complete' === $this->status ) {
771
+									if ('publish' === $this->status || 'complete' === $this->status) {
772 772
 
773 773
 										// Add sales logs.
774
-										$log_date = date_i18n( 'Y-m-d G:i:s', current_time( 'timestamp' ) );
774
+										$log_date = date_i18n('Y-m-d G:i:s', current_time('timestamp'));
775 775
 
776 776
 										$y = 0;
777
-										while ( $y < $quantity ) {
777
+										while ($y < $quantity) {
778 778
 
779
-											give_record_sale_in_log( $item['id'], $this->ID, $price_id, $log_date );
780
-											$y ++;
779
+											give_record_sale_in_log($item['id'], $this->ID, $price_id, $log_date);
780
+											$y++;
781 781
 										}
782 782
 
783
-										$form = new Give_Donate_Form( $item['id'] );
784
-										$form->increase_sales( $quantity );
785
-										$form->increase_earnings( $price );
783
+										$form = new Give_Donate_Form($item['id']);
784
+										$form->increase_sales($quantity);
785
+										$form->increase_earnings($price);
786 786
 
787 787
 										$total_increase += $price;
788 788
 									}
@@ -807,15 +807,15 @@  discard block
 block discarded – undo
807 807
 										),
808 808
 									);
809 809
 
810
-									$found_logs = get_posts( $log_args );
811
-									foreach ( $found_logs as $log ) {
812
-										wp_delete_post( $log->ID, true );
810
+									$found_logs = get_posts($log_args);
811
+									foreach ($found_logs as $log) {
812
+										wp_delete_post($log->ID, true);
813 813
 									}
814 814
 
815
-									if ( 'publish' === $this->status || 'complete' === $this->status ) {
816
-										$form = new Give_Donate_Form( $item['id'] );
817
-										$form->decrease_sales( $quantity );
818
-										$form->decrease_earnings( $item['amount'] );
815
+									if ('publish' === $this->status || 'complete' === $this->status) {
816
+										$form = new Give_Donate_Form($item['id']);
817
+										$form->decrease_sales($quantity);
818
+										$form->decrease_earnings($item['amount']);
819 819
 
820 820
 										$total_decrease += $item['amount'];
821 821
 									}
@@ -827,17 +827,17 @@  discard block
 block discarded – undo
827 827
 
828 828
 					case 'fees':
829 829
 
830
-						if ( 'publish' !== $this->status && 'complete' !== $this->status ) {
830
+						if ('publish' !== $this->status && 'complete' !== $this->status) {
831 831
 							break;
832 832
 						}
833 833
 
834
-						if ( empty( $this->pending[ $key ] ) ) {
834
+						if (empty($this->pending[$key])) {
835 835
 							break;
836 836
 						}
837 837
 
838
-						foreach ( $this->pending[ $key ] as $fee ) {
838
+						foreach ($this->pending[$key] as $fee) {
839 839
 
840
-							switch ( $fee['action'] ) {
840
+							switch ($fee['action']) {
841 841
 
842 842
 								case 'add':
843 843
 									$total_increase += $fee['amount'];
@@ -853,43 +853,43 @@  discard block
 block discarded – undo
853 853
 						break;
854 854
 
855 855
 					case 'status':
856
-						$this->update_status( $this->status );
856
+						$this->update_status($this->status);
857 857
 						break;
858 858
 
859 859
 					case 'gateway':
860
-						$this->update_meta( '_give_payment_gateway', $this->gateway );
860
+						$this->update_meta('_give_payment_gateway', $this->gateway);
861 861
 						break;
862 862
 
863 863
 					case 'mode':
864
-						$this->update_meta( '_give_payment_mode', $this->mode );
864
+						$this->update_meta('_give_payment_mode', $this->mode);
865 865
 						break;
866 866
 
867 867
 					case 'transaction_id':
868
-						$this->update_meta( '_give_payment_transaction_id', $this->transaction_id );
868
+						$this->update_meta('_give_payment_transaction_id', $this->transaction_id);
869 869
 						break;
870 870
 
871 871
 					case 'ip':
872
-						$this->update_meta( '_give_payment_user_ip', $this->ip );
872
+						$this->update_meta('_give_payment_user_ip', $this->ip);
873 873
 						break;
874 874
 
875 875
 					case 'customer_id':
876
-						$this->update_meta( '_give_payment_customer_id', $this->customer_id );
876
+						$this->update_meta('_give_payment_customer_id', $this->customer_id);
877 877
 						break;
878 878
 
879 879
 					case 'user_id':
880
-						$this->update_meta( '_give_payment_user_id', $this->user_id );
880
+						$this->update_meta('_give_payment_user_id', $this->user_id);
881 881
 						break;
882 882
 
883 883
 					case 'form_title':
884
-						$this->update_meta( '_give_payment_form_title', $this->form_title );
884
+						$this->update_meta('_give_payment_form_title', $this->form_title);
885 885
 						break;
886 886
 
887 887
 					case 'form_id':
888
-						$this->update_meta( '_give_payment_form_id', $this->form_id );
888
+						$this->update_meta('_give_payment_form_id', $this->form_id);
889 889
 						break;
890 890
 
891 891
 					case 'price_id':
892
-						$this->update_meta( '_give_payment_price_id', $this->price_id );
892
+						$this->update_meta('_give_payment_price_id', $this->price_id);
893 893
 						break;
894 894
 
895 895
 					case 'first_name':
@@ -905,15 +905,15 @@  discard block
 block discarded – undo
905 905
 						break;
906 906
 
907 907
 					case 'email':
908
-						$this->update_meta( '_give_payment_user_email', $this->email );
908
+						$this->update_meta('_give_payment_user_email', $this->email);
909 909
 						break;
910 910
 
911 911
 					case 'key':
912
-						$this->update_meta( '_give_payment_purchase_key', $this->key );
912
+						$this->update_meta('_give_payment_purchase_key', $this->key);
913 913
 						break;
914 914
 
915 915
 					case 'number':
916
-						$this->update_meta( '_give_payment_number', $this->number );
916
+						$this->update_meta('_give_payment_number', $this->number);
917 917
 						break;
918 918
 
919 919
 					case 'date':
@@ -923,11 +923,11 @@  discard block
 block discarded – undo
923 923
 							'edit_date' => true,
924 924
 						);
925 925
 
926
-						wp_update_post( $args );
926
+						wp_update_post($args);
927 927
 						break;
928 928
 
929 929
 					case 'completed_date':
930
-						$this->update_meta( '_give_completed_date', $this->completed_date );
930
+						$this->update_meta('_give_completed_date', $this->completed_date);
931 931
 						break;
932 932
 
933 933
 					case 'parent_payment':
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
 							'post_parent' => $this->parent_payment,
937 937
 						);
938 938
 
939
-						wp_update_post( $args );
939
+						wp_update_post($args);
940 940
 						break;
941 941
 
942 942
 					default:
@@ -947,33 +947,33 @@  discard block
 block discarded – undo
947 947
 						 *
948 948
 						 * @param Give_Payment $this Payment object.
949 949
 						 */
950
-						do_action( 'give_payment_save', $this, $key );
950
+						do_action('give_payment_save', $this, $key);
951 951
 						break;
952 952
 				}
953 953
 			}
954 954
 
955
-			if ( 'pending' !== $this->status ) {
955
+			if ('pending' !== $this->status) {
956 956
 
957
-				$customer = new Give_Customer( $this->customer_id );
957
+				$customer = new Give_Customer($this->customer_id);
958 958
 
959 959
 				$total_change = $total_increase - $total_decrease;
960
-				if ( $total_change < 0 ) {
960
+				if ($total_change < 0) {
961 961
 
962
-					$total_change = - ( $total_change );
962
+					$total_change = - ($total_change);
963 963
 					// Decrease the customer's donation stats.
964
-					$customer->decrease_value( $total_change );
965
-					give_decrease_total_earnings( $total_change );
964
+					$customer->decrease_value($total_change);
965
+					give_decrease_total_earnings($total_change);
966 966
 
967
-				} elseif ( $total_change > 0 ) {
967
+				} elseif ($total_change > 0) {
968 968
 
969 969
 					// Increase the customer's donation stats.
970
-					$customer->increase_value( $total_change );
971
-					give_increase_total_earnings( $total_change );
970
+					$customer->increase_value($total_change);
971
+					give_increase_total_earnings($total_change);
972 972
 
973 973
 				}
974 974
 			}
975 975
 
976
-			$this->update_meta( '_give_payment_total', $this->total );
976
+			$this->update_meta('_give_payment_total', $this->total);
977 977
 
978 978
 			$new_meta = array(
979 979
 				'form_title' => $this->form_title,
@@ -985,12 +985,12 @@  discard block
 block discarded – undo
985 985
 			);
986 986
 
987 987
 			$meta        = $this->get_meta();
988
-			$merged_meta = array_merge( $meta, $new_meta );
988
+			$merged_meta = array_merge($meta, $new_meta);
989 989
 
990 990
 			// Only save the payment meta if it's changed.
991
-			if ( md5( serialize( $meta ) ) !== md5( serialize( $merged_meta ) ) ) {
992
-				$updated = $this->update_meta( '_give_payment_meta', $merged_meta );
993
-				if ( false !== $updated ) {
991
+			if (md5(serialize($meta)) !== md5(serialize($merged_meta))) {
992
+				$updated = $this->update_meta('_give_payment_meta', $merged_meta);
993
+				if (false !== $updated) {
994 994
 					$saved = true;
995 995
 				}
996 996
 			}
@@ -999,8 +999,8 @@  discard block
 block discarded – undo
999 999
 			$saved         = true;
1000 1000
 		}
1001 1001
 
1002
-		if ( true === $saved ) {
1003
-			$this->setup_payment( $this->ID );
1002
+		if (true === $saved) {
1003
+			$this->setup_payment($this->ID);
1004 1004
 		}
1005 1005
 
1006 1006
 		return $saved;
@@ -1018,12 +1018,12 @@  discard block
 block discarded – undo
1018 1018
 	 *
1019 1019
 	 * @return bool           True when successful, false otherwise
1020 1020
 	 */
1021
-	public function add_donation( $form_id = 0, $args = array(), $options = array() ) {
1021
+	public function add_donation($form_id = 0, $args = array(), $options = array()) {
1022 1022
 
1023
-		$donation = new Give_Donate_Form( $form_id );
1023
+		$donation = new Give_Donate_Form($form_id);
1024 1024
 
1025 1025
 		// Bail if this post isn't a give donation form.
1026
-		if ( ! $donation || $donation->post_type !== 'give_forms' ) {
1026
+		if ( ! $donation || $donation->post_type !== 'give_forms') {
1027 1027
 			return false;
1028 1028
 		}
1029 1029
 
@@ -1034,59 +1034,59 @@  discard block
 block discarded – undo
1034 1034
 			'fees'     => array(),
1035 1035
 		);
1036 1036
 
1037
-		$args = wp_parse_args( apply_filters( 'give_payment_add_donation_args', $args, $donation->ID ), $defaults );
1037
+		$args = wp_parse_args(apply_filters('give_payment_add_donation_args', $args, $donation->ID), $defaults);
1038 1038
 
1039 1039
 		// Allow overriding the price.
1040
-		if ( false !== $args['price'] ) {
1040
+		if (false !== $args['price']) {
1041 1041
 			$item_price = $args['price'];
1042 1042
 		} else {
1043 1043
 
1044 1044
 			// Deal with variable pricing.
1045
-			if ( give_has_variable_prices( $donation->ID ) ) {
1046
-				$prices     = maybe_unserialize( get_post_meta( $form_id, '_give_donation_levels', true ) );
1045
+			if (give_has_variable_prices($donation->ID)) {
1046
+				$prices     = maybe_unserialize(get_post_meta($form_id, '_give_donation_levels', true));
1047 1047
 				$item_price = '';
1048 1048
 				// Loop through prices.
1049
-				foreach ( $prices as $price ) {
1049
+				foreach ($prices as $price) {
1050 1050
 					// Find a match between price_id and level_id.
1051 1051
 					// First verify array keys exists THEN make the match.
1052
-					if ( ( isset( $args['price_id'] ) && isset( $price['_give_id']['level_id'] ) )
1052
+					if ((isset($args['price_id']) && isset($price['_give_id']['level_id']))
1053 1053
 					     && $args['price_id'] == $price['_give_id']['level_id']
1054 1054
 					) {
1055 1055
 						$item_price = $price['_give_amount'];
1056 1056
 					}
1057 1057
 				}
1058 1058
 				// Fallback to the lowest price point.
1059
-				if ( $item_price == '' ) {
1060
-					$item_price       = give_get_lowest_price_option( $donation->ID );
1061
-					$args['price_id'] = give_get_lowest_price_id( $donation->ID );
1059
+				if ($item_price == '') {
1060
+					$item_price       = give_get_lowest_price_option($donation->ID);
1061
+					$args['price_id'] = give_get_lowest_price_id($donation->ID);
1062 1062
 				}
1063 1063
 			} else {
1064 1064
 				// Simple form price.
1065
-				$item_price = give_get_form_price( $donation->ID );
1065
+				$item_price = give_get_form_price($donation->ID);
1066 1066
 			}
1067 1067
 		}
1068 1068
 
1069 1069
 		// Sanitizing the price here so we don't have a dozen calls later.
1070
-		$item_price = give_sanitize_amount( $item_price );
1071
-		$total      = round( $item_price, give_currency_decimal_filter() );
1070
+		$item_price = give_sanitize_amount($item_price);
1071
+		$total      = round($item_price, give_currency_decimal_filter());
1072 1072
 
1073 1073
 		// Add Options.
1074 1074
 		$default_options = array();
1075
-		if ( false !== $args['price_id'] ) {
1075
+		if (false !== $args['price_id']) {
1076 1076
 			$default_options['price_id'] = (int) $args['price_id'];
1077 1077
 		}
1078
-		$options = wp_parse_args( $options, $default_options );
1078
+		$options = wp_parse_args($options, $default_options);
1079 1079
 
1080 1080
 		// Do not allow totals to go negative.
1081
-		if ( $total < 0 ) {
1081
+		if ($total < 0) {
1082 1082
 			$total = 0;
1083 1083
 		}
1084 1084
 
1085 1085
 		$donation = array(
1086 1086
 			'name'     => $donation->post_title,
1087 1087
 			'id'       => $donation->ID,
1088
-			'price'    => round( $total, give_currency_decimal_filter() ),
1089
-			'subtotal' => round( $total, give_currency_decimal_filter() ),
1088
+			'price'    => round($total, give_currency_decimal_filter()),
1089
+			'subtotal' => round($total, give_currency_decimal_filter()),
1090 1090
 			'fees'     => $args['fees'],
1091 1091
 			'price_id' => $args['price_id'],
1092 1092
 			'action'   => 'add',
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
 
1096 1096
 		$this->pending['donations'][] = $donation;
1097 1097
 
1098
-		$this->increase_subtotal( $total );
1098
+		$this->increase_subtotal($total);
1099 1099
 
1100 1100
 		return true;
1101 1101
 
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 	 *
1113 1113
 	 * @return bool           If the item was removed or not
1114 1114
 	 */
1115
-	public function remove_donation( $form_id, $args = array() ) {
1115
+	public function remove_donation($form_id, $args = array()) {
1116 1116
 
1117 1117
 		// Set some defaults.
1118 1118
 		$defaults = array(
@@ -1120,12 +1120,12 @@  discard block
 block discarded – undo
1120 1120
 			'price'    => false,
1121 1121
 			'price_id' => false,
1122 1122
 		);
1123
-		$args     = wp_parse_args( $args, $defaults );
1123
+		$args = wp_parse_args($args, $defaults);
1124 1124
 
1125
-		$form = new Give_Donate_Form( $form_id );
1125
+		$form = new Give_Donate_Form($form_id);
1126 1126
 
1127 1127
 		// Bail if this post isn't a valid give donation form.
1128
-		if ( ! $form || $form->post_type !== 'give_forms' ) {
1128
+		if ( ! $form || $form->post_type !== 'give_forms') {
1129 1129
 			return false;
1130 1130
 		}
1131 1131
 
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 
1139 1139
 		$this->pending['donations'][] = $pending_args;
1140 1140
 
1141
-		$this->decrease_subtotal( $this->total );
1141
+		$this->decrease_subtotal($this->total);
1142 1142
 
1143 1143
 		return true;
1144 1144
 	}
@@ -1154,7 +1154,7 @@  discard block
 block discarded – undo
1154 1154
 	 *
1155 1155
 	 * @return bool          If the fee was added
1156 1156
 	 */
1157
-	public function add_fee( $args, $global = true ) {
1157
+	public function add_fee($args, $global = true) {
1158 1158
 
1159 1159
 		$default_args = array(
1160 1160
 			'label'    => '',
@@ -1164,15 +1164,15 @@  discard block
 block discarded – undo
1164 1164
 			'price_id' => 0,
1165 1165
 		);
1166 1166
 
1167
-		$fee          = wp_parse_args( $args, $default_args );
1167
+		$fee          = wp_parse_args($args, $default_args);
1168 1168
 		$this->fees[] = $fee;
1169 1169
 
1170 1170
 		$added_fee               = $fee;
1171 1171
 		$added_fee['action']     = 'add';
1172 1172
 		$this->pending['fees'][] = $added_fee;
1173
-		reset( $this->fees );
1173
+		reset($this->fees);
1174 1174
 
1175
-		$this->increase_fees( $fee['amount'] );
1175
+		$this->increase_fees($fee['amount']);
1176 1176
 
1177 1177
 		return true;
1178 1178
 	}
@@ -1187,11 +1187,11 @@  discard block
 block discarded – undo
1187 1187
 	 *
1188 1188
 	 * @return bool     If the fee was removed successfully
1189 1189
 	 */
1190
-	public function remove_fee( $key ) {
1190
+	public function remove_fee($key) {
1191 1191
 		$removed = false;
1192 1192
 
1193
-		if ( is_numeric( $key ) ) {
1194
-			$removed = $this->remove_fee_by( 'index', $key );
1193
+		if (is_numeric($key)) {
1194
+			$removed = $this->remove_fee_by('index', $key);
1195 1195
 		}
1196 1196
 
1197 1197
 		return $removed;
@@ -1210,55 +1210,55 @@  discard block
 block discarded – undo
1210 1210
 	 *
1211 1211
 	 * @return boolean            If the item is removed
1212 1212
 	 */
1213
-	public function remove_fee_by( $key, $value, $global = false ) {
1213
+	public function remove_fee_by($key, $value, $global = false) {
1214 1214
 
1215
-		$allowed_fee_keys = apply_filters( 'give_payment_fee_keys', array(
1215
+		$allowed_fee_keys = apply_filters('give_payment_fee_keys', array(
1216 1216
 			'index',
1217 1217
 			'label',
1218 1218
 			'amount',
1219 1219
 			'type',
1220
-		) );
1220
+		));
1221 1221
 
1222
-		if ( ! in_array( $key, $allowed_fee_keys ) ) {
1222
+		if ( ! in_array($key, $allowed_fee_keys)) {
1223 1223
 			return false;
1224 1224
 		}
1225 1225
 
1226 1226
 		$removed = false;
1227
-		if ( 'index' === $key && array_key_exists( $value, $this->fees ) ) {
1227
+		if ('index' === $key && array_key_exists($value, $this->fees)) {
1228 1228
 
1229
-			$removed_fee             = $this->fees[ $value ];
1229
+			$removed_fee             = $this->fees[$value];
1230 1230
 			$removed_fee['action']   = 'remove';
1231 1231
 			$this->pending['fees'][] = $removed_fee;
1232 1232
 
1233
-			$this->decrease_fees( $removed_fee['amount'] );
1233
+			$this->decrease_fees($removed_fee['amount']);
1234 1234
 
1235
-			unset( $this->fees[ $value ] );
1235
+			unset($this->fees[$value]);
1236 1236
 			$removed = true;
1237 1237
 
1238
-		} elseif ( 'index' !== $key ) {
1238
+		} elseif ('index' !== $key) {
1239 1239
 
1240
-			foreach ( $this->fees as $index => $fee ) {
1240
+			foreach ($this->fees as $index => $fee) {
1241 1241
 
1242
-				if ( isset( $fee[ $key ] ) && $fee[ $key ] == $value ) {
1242
+				if (isset($fee[$key]) && $fee[$key] == $value) {
1243 1243
 
1244 1244
 					$removed_fee             = $fee;
1245 1245
 					$removed_fee['action']   = 'remove';
1246 1246
 					$this->pending['fees'][] = $removed_fee;
1247 1247
 
1248
-					$this->decrease_fees( $removed_fee['amount'] );
1248
+					$this->decrease_fees($removed_fee['amount']);
1249 1249
 
1250
-					unset( $this->fees[ $index ] );
1250
+					unset($this->fees[$index]);
1251 1251
 					$removed = true;
1252 1252
 
1253
-					if ( false === $global ) {
1253
+					if (false === $global) {
1254 1254
 						break;
1255 1255
 					}
1256 1256
 				}
1257 1257
 			}
1258 1258
 		}
1259 1259
 
1260
-		if ( true === $removed ) {
1261
-			$this->fees = array_values( $this->fees );
1260
+		if (true === $removed) {
1261
+			$this->fees = array_values($this->fees);
1262 1262
 		}
1263 1263
 
1264 1264
 		return $removed;
@@ -1274,14 +1274,14 @@  discard block
 block discarded – undo
1274 1274
 	 *
1275 1275
 	 * @return array        The Fees for the type specified
1276 1276
 	 */
1277
-	public function get_fees( $type = 'all' ) {
1277
+	public function get_fees($type = 'all') {
1278 1278
 		$fees = array();
1279 1279
 
1280
-		if ( ! empty( $this->fees ) && is_array( $this->fees ) ) {
1280
+		if ( ! empty($this->fees) && is_array($this->fees)) {
1281 1281
 
1282
-			foreach ( $this->fees as $fee_id => $fee ) {
1282
+			foreach ($this->fees as $fee_id => $fee) {
1283 1283
 
1284
-				if ( 'all' != $type && ! empty( $fee['type'] ) && $type != $fee['type'] ) {
1284
+				if ('all' != $type && ! empty($fee['type']) && $type != $fee['type']) {
1285 1285
 					continue;
1286 1286
 				}
1287 1287
 
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 			}
1292 1292
 		}
1293 1293
 
1294
-		return apply_filters( 'give_get_payment_fees', $fees, $this->ID, $this );
1294
+		return apply_filters('give_get_payment_fees', $fees, $this->ID, $this);
1295 1295
 	}
1296 1296
 
1297 1297
 	/**
@@ -1304,13 +1304,13 @@  discard block
 block discarded – undo
1304 1304
 	 *
1305 1305
 	 * @return void
1306 1306
 	 */
1307
-	public function add_note( $note = false ) {
1307
+	public function add_note($note = false) {
1308 1308
 		// Bail if no note specified.
1309
-		if ( ! $note ) {
1309
+		if ( ! $note) {
1310 1310
 			return false;
1311 1311
 		}
1312 1312
 
1313
-		give_insert_payment_note( $this->ID, $note );
1313
+		give_insert_payment_note($this->ID, $note);
1314 1314
 	}
1315 1315
 
1316 1316
 	/**
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
 	 *
1324 1324
 	 * @return void
1325 1325
 	 */
1326
-	private function increase_subtotal( $amount = 0.00 ) {
1326
+	private function increase_subtotal($amount = 0.00) {
1327 1327
 		$amount = (float) $amount;
1328 1328
 		$this->subtotal += $amount;
1329 1329
 
@@ -1340,11 +1340,11 @@  discard block
 block discarded – undo
1340 1340
 	 *
1341 1341
 	 * @return void
1342 1342
 	 */
1343
-	private function decrease_subtotal( $amount = 0.00 ) {
1343
+	private function decrease_subtotal($amount = 0.00) {
1344 1344
 		$amount = (float) $amount;
1345 1345
 		$this->subtotal -= $amount;
1346 1346
 
1347
-		if ( $this->subtotal < 0 ) {
1347
+		if ($this->subtotal < 0) {
1348 1348
 			$this->subtotal = 0;
1349 1349
 		}
1350 1350
 
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 	 *
1362 1362
 	 * @return void
1363 1363
 	 */
1364
-	private function increase_fees( $amount = 0.00 ) {
1364
+	private function increase_fees($amount = 0.00) {
1365 1365
 		$amount = (float) $amount;
1366 1366
 		$this->fees_total += $amount;
1367 1367
 
@@ -1378,11 +1378,11 @@  discard block
 block discarded – undo
1378 1378
 	 *
1379 1379
 	 * @return void
1380 1380
 	 */
1381
-	private function decrease_fees( $amount = 0.00 ) {
1381
+	private function decrease_fees($amount = 0.00) {
1382 1382
 		$amount = (float) $amount;
1383 1383
 		$this->fees_total -= $amount;
1384 1384
 
1385
-		if ( $this->fees_total < 0 ) {
1385
+		if ($this->fees_total < 0) {
1386 1386
 			$this->fees_total = 0;
1387 1387
 		}
1388 1388
 
@@ -1411,24 +1411,24 @@  discard block
 block discarded – undo
1411 1411
 	 *
1412 1412
 	 * @return bool   $updated Returns if the status was successfully updated.
1413 1413
 	 */
1414
-	public function update_status( $status = false ) {
1414
+	public function update_status($status = false) {
1415 1415
 
1416 1416
 		// standardize the 'complete(d)' status.
1417
-		if ( $status == 'completed' || $status == 'complete' ) {
1417
+		if ($status == 'completed' || $status == 'complete') {
1418 1418
 			$status = 'publish';
1419 1419
 		}
1420 1420
 
1421
-		$old_status = ! empty( $this->old_status ) ? $this->old_status : false;
1421
+		$old_status = ! empty($this->old_status) ? $this->old_status : false;
1422 1422
 
1423
-		if ( $old_status === $status ) {
1423
+		if ($old_status === $status) {
1424 1424
 			return false; // Don't permit status changes that aren't changes.
1425 1425
 		}
1426 1426
 
1427
-		$do_change = apply_filters( 'give_should_update_payment_status', true, $this->ID, $status, $old_status );
1427
+		$do_change = apply_filters('give_should_update_payment_status', true, $this->ID, $status, $old_status);
1428 1428
 
1429 1429
 		$updated = false;
1430 1430
 
1431
-		if ( $do_change ) {
1431
+		if ($do_change) {
1432 1432
 
1433 1433
 			/**
1434 1434
 			 * Fires before changing payment status.
@@ -1439,21 +1439,21 @@  discard block
 block discarded – undo
1439 1439
 			 * @param string $status     The new status.
1440 1440
 			 * @param string $old_status The old status.
1441 1441
 			 */
1442
-			do_action( 'give_before_payment_status_change', $this->ID, $status, $old_status );
1442
+			do_action('give_before_payment_status_change', $this->ID, $status, $old_status);
1443 1443
 
1444 1444
 			$update_fields = array(
1445 1445
 				'ID'          => $this->ID,
1446 1446
 				'post_status' => $status,
1447
-				'edit_date'   => current_time( 'mysql' ),
1447
+				'edit_date'   => current_time('mysql'),
1448 1448
 			);
1449 1449
 
1450
-			$updated = wp_update_post( apply_filters( 'give_update_payment_status_fields', $update_fields ) );
1450
+			$updated = wp_update_post(apply_filters('give_update_payment_status_fields', $update_fields));
1451 1451
 
1452 1452
 			$all_payment_statuses  = give_get_payment_statuses();
1453
-			$this->status_nicename = array_key_exists( $status, $all_payment_statuses ) ? $all_payment_statuses[ $status ] : ucfirst( $status );
1453
+			$this->status_nicename = array_key_exists($status, $all_payment_statuses) ? $all_payment_statuses[$status] : ucfirst($status);
1454 1454
 
1455 1455
 			// Process any specific status functions.
1456
-			switch ( $status ) {
1456
+			switch ($status) {
1457 1457
 				case 'refunded':
1458 1458
 					$this->process_refund();
1459 1459
 					break;
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
 			 * @param string $status     The new status.
1481 1481
 			 * @param string $old_status The old status.
1482 1482
 			 */
1483
-			do_action( 'give_update_payment_status', $this->ID, $status, $old_status );
1483
+			do_action('give_update_payment_status', $this->ID, $status, $old_status);
1484 1484
 
1485 1485
 		}
1486 1486
 
@@ -1515,33 +1515,33 @@  discard block
 block discarded – undo
1515 1515
 	 *
1516 1516
 	 * @return mixed             The value from the post meta
1517 1517
 	 */
1518
-	public function get_meta( $meta_key = '_give_payment_meta', $single = true ) {
1518
+	public function get_meta($meta_key = '_give_payment_meta', $single = true) {
1519 1519
 
1520
-		$meta = get_post_meta( $this->ID, $meta_key, $single );
1520
+		$meta = get_post_meta($this->ID, $meta_key, $single);
1521 1521
 
1522
-		if ( $meta_key === '_give_payment_meta' ) {
1522
+		if ($meta_key === '_give_payment_meta') {
1523 1523
 			$meta = (array) $meta;
1524 1524
 
1525
-			if ( empty( $meta['key'] ) ) {
1525
+			if (empty($meta['key'])) {
1526 1526
 				$meta['key'] = $this->setup_payment_key();
1527 1527
 			}
1528 1528
 
1529
-			if ( empty( $meta['form_title'] ) ) {
1529
+			if (empty($meta['form_title'])) {
1530 1530
 				$meta['form_title'] = $this->setup_form_title();
1531 1531
 			}
1532 1532
 
1533
-			if ( empty( $meta['email'] ) ) {
1533
+			if (empty($meta['email'])) {
1534 1534
 				$meta['email'] = $this->setup_email();
1535 1535
 			}
1536 1536
 
1537
-			if ( empty( $meta['date'] ) ) {
1538
-				$meta['date'] = get_post_field( 'post_date', $this->ID );
1537
+			if (empty($meta['date'])) {
1538
+				$meta['date'] = get_post_field('post_date', $this->ID);
1539 1539
 			}
1540 1540
 		}
1541 1541
 
1542
-		$meta = apply_filters( "give_get_payment_meta_{$meta_key}", $meta, $this->ID );
1542
+		$meta = apply_filters("give_get_payment_meta_{$meta_key}", $meta, $this->ID);
1543 1543
 
1544
-		return apply_filters( 'give_get_payment_meta', $meta, $this->ID, $meta_key );
1544
+		return apply_filters('give_get_payment_meta', $meta, $this->ID, $meta_key);
1545 1545
 	}
1546 1546
 
1547 1547
 	/**
@@ -1556,23 +1556,23 @@  discard block
 block discarded – undo
1556 1556
 	 *
1557 1557
 	 * @return int|bool           Meta ID if the key didn't exist, true on successful update, false on failure
1558 1558
 	 */
1559
-	public function update_meta( $meta_key = '', $meta_value = '', $prev_value = '' ) {
1560
-		if ( empty( $meta_key ) ) {
1559
+	public function update_meta($meta_key = '', $meta_value = '', $prev_value = '') {
1560
+		if (empty($meta_key)) {
1561 1561
 			return false;
1562 1562
 		}
1563 1563
 
1564
-		if ( $meta_key == 'key' || $meta_key == 'date' ) {
1564
+		if ($meta_key == 'key' || $meta_key == 'date') {
1565 1565
 
1566 1566
 			$current_meta              = $this->get_meta();
1567
-			$current_meta[ $meta_key ] = $meta_value;
1567
+			$current_meta[$meta_key] = $meta_value;
1568 1568
 
1569 1569
 			$meta_key   = '_give_payment_meta';
1570 1570
 			$meta_value = $current_meta;
1571 1571
 
1572
-		} elseif ( $meta_key == 'email' || $meta_key == '_give_payment_user_email' ) {
1572
+		} elseif ($meta_key == 'email' || $meta_key == '_give_payment_user_email') {
1573 1573
 
1574
-			$meta_value = apply_filters( "give_give_update_payment_meta_{$meta_key}", $meta_value, $this->ID );
1575
-			update_post_meta( $this->ID, '_give_payment_user_email', $meta_value );
1574
+			$meta_value = apply_filters("give_give_update_payment_meta_{$meta_key}", $meta_value, $this->ID);
1575
+			update_post_meta($this->ID, '_give_payment_user_email', $meta_value);
1576 1576
 
1577 1577
 			$current_meta                       = $this->get_meta();
1578 1578
 			$current_meta['user_info']['email'] = $meta_value;
@@ -1582,9 +1582,9 @@  discard block
 block discarded – undo
1582 1582
 
1583 1583
 		}
1584 1584
 
1585
-		$meta_value = apply_filters( "give_update_payment_meta_{$meta_key}", $meta_value, $this->ID );
1585
+		$meta_value = apply_filters("give_update_payment_meta_{$meta_key}", $meta_value, $this->ID);
1586 1586
 
1587
-		return update_post_meta( $this->ID, $meta_key, $meta_value, $prev_value );
1587
+		return update_post_meta($this->ID, $meta_key, $meta_value, $prev_value);
1588 1588
 	}
1589 1589
 
1590 1590
 	/**
@@ -1599,14 +1599,14 @@  discard block
 block discarded – undo
1599 1599
 		$process_refund = true;
1600 1600
 
1601 1601
 		// If the payment was not in publish or revoked status, don't decrement stats as they were never incremented.
1602
-		if ( 'publish' != $this->old_status || 'refunded' != $this->status ) {
1602
+		if ('publish' != $this->old_status || 'refunded' != $this->status) {
1603 1603
 			$process_refund = false;
1604 1604
 		}
1605 1605
 
1606 1606
 		// Allow extensions to filter for their own payment types, Example: Recurring Payments.
1607
-		$process_refund = apply_filters( 'give_should_process_refund', $process_refund, $this );
1607
+		$process_refund = apply_filters('give_should_process_refund', $process_refund, $this);
1608 1608
 
1609
-		if ( false === $process_refund ) {
1609
+		if (false === $process_refund) {
1610 1610
 			return;
1611 1611
 		}
1612 1612
 
@@ -1617,17 +1617,17 @@  discard block
 block discarded – undo
1617 1617
 		 *
1618 1618
 		 * @param Give_Payment $this Payment object.
1619 1619
 		 */
1620
-		do_action( 'give_pre_refund_payment', $this );
1620
+		do_action('give_pre_refund_payment', $this);
1621 1621
 
1622
-		$decrease_store_earnings = apply_filters( 'give_decrease_store_earnings_on_refund', true, $this );
1623
-		$decrease_customer_value = apply_filters( 'give_decrease_customer_value_on_refund', true, $this );
1624
-		$decrease_purchase_count = apply_filters( 'give_decrease_customer_purchase_count_on_refund', true, $this );
1622
+		$decrease_store_earnings = apply_filters('give_decrease_store_earnings_on_refund', true, $this);
1623
+		$decrease_customer_value = apply_filters('give_decrease_customer_value_on_refund', true, $this);
1624
+		$decrease_purchase_count = apply_filters('give_decrease_customer_purchase_count_on_refund', true, $this);
1625 1625
 
1626
-		$this->maybe_alter_stats( $decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count );
1626
+		$this->maybe_alter_stats($decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count);
1627 1627
 		$this->delete_sales_logs();
1628 1628
 
1629 1629
 		// Clear the This Month earnings (this_monththis_month is NOT a typo).
1630
-		delete_transient( md5( 'give_earnings_this_monththis_month' ) );
1630
+		delete_transient(md5('give_earnings_this_monththis_month'));
1631 1631
 
1632 1632
 		/**
1633 1633
 		 * Fires after refunding payment.
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
 		 *
1637 1637
 		 * @param Give_Payment $this Payment object.
1638 1638
 		 */
1639
-		do_action( 'give_post_refund_payment', $this );
1639
+		do_action('give_post_refund_payment', $this);
1640 1640
 	}
1641 1641
 
1642 1642
 	/**
@@ -1663,29 +1663,29 @@  discard block
 block discarded – undo
1663 1663
 		$process_pending = true;
1664 1664
 
1665 1665
 		// If the payment was not in publish or revoked status, don't decrement stats as they were never incremented.
1666
-		if ( 'publish' != $this->old_status || 'pending' != $this->status ) {
1666
+		if ('publish' != $this->old_status || 'pending' != $this->status) {
1667 1667
 			$process_pending = false;
1668 1668
 		}
1669 1669
 
1670 1670
 		// Allow extensions to filter for their own payment types, Example: Recurring Payments.
1671
-		$process_pending = apply_filters( 'give_should_process_pending', $process_pending, $this );
1671
+		$process_pending = apply_filters('give_should_process_pending', $process_pending, $this);
1672 1672
 
1673
-		if ( false === $process_pending ) {
1673
+		if (false === $process_pending) {
1674 1674
 			return;
1675 1675
 		}
1676 1676
 
1677
-		$decrease_store_earnings = apply_filters( 'give_decrease_store_earnings_on_pending', true, $this );
1678
-		$decrease_customer_value = apply_filters( 'give_decrease_customer_value_on_pending', true, $this );
1679
-		$decrease_purchase_count = apply_filters( 'give_decrease_customer_purchase_count_on_pending', true, $this );
1677
+		$decrease_store_earnings = apply_filters('give_decrease_store_earnings_on_pending', true, $this);
1678
+		$decrease_customer_value = apply_filters('give_decrease_customer_value_on_pending', true, $this);
1679
+		$decrease_purchase_count = apply_filters('give_decrease_customer_purchase_count_on_pending', true, $this);
1680 1680
 
1681
-		$this->maybe_alter_stats( $decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count );
1681
+		$this->maybe_alter_stats($decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count);
1682 1682
 		$this->delete_sales_logs();
1683 1683
 
1684 1684
 		$this->completed_date = false;
1685
-		$this->update_meta( '_give_completed_date', '' );
1685
+		$this->update_meta('_give_completed_date', '');
1686 1686
 
1687 1687
 		// Clear the This Month earnings (this_monththis_month is NOT a typo).
1688
-		delete_transient( md5( 'give_earnings_this_monththis_month' ) );
1688
+		delete_transient(md5('give_earnings_this_monththis_month'));
1689 1689
 	}
1690 1690
 
1691 1691
 	/**
@@ -1700,29 +1700,29 @@  discard block
 block discarded – undo
1700 1700
 		$process_cancelled = true;
1701 1701
 
1702 1702
 		// If the payment was not in publish or revoked status, don't decrement stats as they were never incremented.
1703
-		if ( 'publish' != $this->old_status || 'cancelled' != $this->status ) {
1703
+		if ('publish' != $this->old_status || 'cancelled' != $this->status) {
1704 1704
 			$process_cancelled = false;
1705 1705
 		}
1706 1706
 
1707 1707
 		// Allow extensions to filter for their own payment types, Example: Recurring Payments.
1708
-		$process_cancelled = apply_filters( 'give_should_process_cancelled', $process_cancelled, $this );
1708
+		$process_cancelled = apply_filters('give_should_process_cancelled', $process_cancelled, $this);
1709 1709
 
1710
-		if ( false === $process_cancelled ) {
1710
+		if (false === $process_cancelled) {
1711 1711
 			return;
1712 1712
 		}
1713 1713
 
1714
-		$decrease_store_earnings = apply_filters( 'give_decrease_store_earnings_on_cancelled', true, $this );
1715
-		$decrease_customer_value = apply_filters( 'give_decrease_customer_value_on_cancelled', true, $this );
1716
-		$decrease_purchase_count = apply_filters( 'give_decrease_customer_purchase_count_on_cancelled', true, $this );
1714
+		$decrease_store_earnings = apply_filters('give_decrease_store_earnings_on_cancelled', true, $this);
1715
+		$decrease_customer_value = apply_filters('give_decrease_customer_value_on_cancelled', true, $this);
1716
+		$decrease_purchase_count = apply_filters('give_decrease_customer_purchase_count_on_cancelled', true, $this);
1717 1717
 
1718
-		$this->maybe_alter_stats( $decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count );
1718
+		$this->maybe_alter_stats($decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count);
1719 1719
 		$this->delete_sales_logs();
1720 1720
 
1721 1721
 		$this->completed_date = false;
1722
-		$this->update_meta( '_give_completed_date', '' );
1722
+		$this->update_meta('_give_completed_date', '');
1723 1723
 
1724 1724
 		// Clear the This Month earnings (this_monththis_month is NOT a typo).
1725
-		delete_transient( md5( 'give_earnings_this_monththis_month' ) );
1725
+		delete_transient(md5('give_earnings_this_monththis_month'));
1726 1726
 	}
1727 1727
 
1728 1728
 	/**
@@ -1735,29 +1735,29 @@  discard block
 block discarded – undo
1735 1735
 		$process_revoked = true;
1736 1736
 
1737 1737
 		// If the payment was not in publish, don't decrement stats as they were never incremented.
1738
-		if ( 'publish' != $this->old_status || 'revoked' != $this->status ) {
1738
+		if ('publish' != $this->old_status || 'revoked' != $this->status) {
1739 1739
 			$process_revoked = false;
1740 1740
 		}
1741 1741
 
1742 1742
 		// Allow extensions to filter for their own payment types, Example: Recurring Payments.
1743
-		$process_revoked = apply_filters( 'give_should_process_revoked', $process_revoked, $this );
1743
+		$process_revoked = apply_filters('give_should_process_revoked', $process_revoked, $this);
1744 1744
 
1745
-		if ( false === $process_revoked ) {
1745
+		if (false === $process_revoked) {
1746 1746
 			return;
1747 1747
 		}
1748 1748
 
1749
-		$decrease_store_earnings = apply_filters( 'give_decrease_store_earnings_on_revoked', true, $this );
1750
-		$decrease_customer_value = apply_filters( 'give_decrease_customer_value_on_revoked', true, $this );
1751
-		$decrease_purchase_count = apply_filters( 'give_decrease_customer_purchase_count_on_revoked', true, $this );
1749
+		$decrease_store_earnings = apply_filters('give_decrease_store_earnings_on_revoked', true, $this);
1750
+		$decrease_customer_value = apply_filters('give_decrease_customer_value_on_revoked', true, $this);
1751
+		$decrease_purchase_count = apply_filters('give_decrease_customer_purchase_count_on_revoked', true, $this);
1752 1752
 
1753
-		$this->maybe_alter_stats( $decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count );
1753
+		$this->maybe_alter_stats($decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count);
1754 1754
 		$this->delete_sales_logs();
1755 1755
 
1756 1756
 		$this->completed_date = false;
1757
-		$this->update_meta( '_give_completed_date', '' );
1757
+		$this->update_meta('_give_completed_date', '');
1758 1758
 
1759 1759
 		// Clear the This Month earnings (this_monththis_month is NOT a typo).
1760
-		delete_transient( md5( 'give_earnings_this_monththis_month' ) );
1760
+		delete_transient(md5('give_earnings_this_monththis_month'));
1761 1761
 	}
1762 1762
 
1763 1763
 	/**
@@ -1772,25 +1772,25 @@  discard block
 block discarded – undo
1772 1772
 	 *
1773 1773
 	 * @return void
1774 1774
 	 */
1775
-	private function maybe_alter_stats( $alter_store_earnings, $alter_customer_value, $alter_customer_purchase_count ) {
1775
+	private function maybe_alter_stats($alter_store_earnings, $alter_customer_value, $alter_customer_purchase_count) {
1776 1776
 
1777
-		give_undo_purchase( false, $this->ID );
1777
+		give_undo_purchase(false, $this->ID);
1778 1778
 
1779 1779
 		// Decrease store earnings.
1780
-		if ( true === $alter_store_earnings ) {
1781
-			give_decrease_total_earnings( $this->total );
1780
+		if (true === $alter_store_earnings) {
1781
+			give_decrease_total_earnings($this->total);
1782 1782
 		}
1783 1783
 
1784 1784
 		// Decrement the stats for the customer.
1785
-		if ( ! empty( $this->customer_id ) ) {
1785
+		if ( ! empty($this->customer_id)) {
1786 1786
 
1787
-			$customer = new Give_Customer( $this->customer_id );
1787
+			$customer = new Give_Customer($this->customer_id);
1788 1788
 
1789
-			if ( true === $alter_customer_value ) {
1790
-				$customer->decrease_value( $this->total );
1789
+			if (true === $alter_customer_value) {
1790
+				$customer->decrease_value($this->total);
1791 1791
 			}
1792 1792
 
1793
-			if ( true === $alter_customer_purchase_count ) {
1793
+			if (true === $alter_customer_purchase_count) {
1794 1794
 				$customer->decrease_purchase_count();
1795 1795
 			}
1796 1796
 		}
@@ -1839,13 +1839,13 @@  discard block
 block discarded – undo
1839 1839
 	 * @return string The date the payment was completed
1840 1840
 	 */
1841 1841
 	private function setup_completed_date() {
1842
-		$payment = get_post( $this->ID );
1842
+		$payment = get_post($this->ID);
1843 1843
 
1844
-		if ( 'pending' == $payment->post_status || 'preapproved' == $payment->post_status ) {
1844
+		if ('pending' == $payment->post_status || 'preapproved' == $payment->post_status) {
1845 1845
 			return false; // This payment was never completed.
1846 1846
 		}
1847 1847
 
1848
-		$date = ( $date = $this->get_meta( '_give_completed_date', true ) ) ? $date : $payment->modified_date;
1848
+		$date = ($date = $this->get_meta('_give_completed_date', true)) ? $date : $payment->modified_date;
1849 1849
 
1850 1850
 		return $date;
1851 1851
 	}
@@ -1859,7 +1859,7 @@  discard block
 block discarded – undo
1859 1859
 	 * @return string The payment mode
1860 1860
 	 */
1861 1861
 	private function setup_mode() {
1862
-		return $this->get_meta( '_give_payment_mode' );
1862
+		return $this->get_meta('_give_payment_mode');
1863 1863
 	}
1864 1864
 
1865 1865
 	/**
@@ -1871,19 +1871,19 @@  discard block
 block discarded – undo
1871 1871
 	 * @return float The payment total
1872 1872
 	 */
1873 1873
 	private function setup_total() {
1874
-		$amount = $this->get_meta( '_give_payment_total', true );
1874
+		$amount = $this->get_meta('_give_payment_total', true);
1875 1875
 
1876
-		if ( empty( $amount ) && '0.00' != $amount ) {
1877
-			$meta = $this->get_meta( '_give_payment_meta', true );
1878
-			$meta = maybe_unserialize( $meta );
1876
+		if (empty($amount) && '0.00' != $amount) {
1877
+			$meta = $this->get_meta('_give_payment_meta', true);
1878
+			$meta = maybe_unserialize($meta);
1879 1879
 
1880
-			if ( isset( $meta['amount'] ) ) {
1880
+			if (isset($meta['amount'])) {
1881 1881
 				$amount = $meta['amount'];
1882 1882
 			}
1883 1883
 		}
1884 1884
 
1885 1885
 
1886
-		return round( floatval( $amount ), give_currency_decimal_filter() );
1886
+		return round(floatval($amount), give_currency_decimal_filter());
1887 1887
 	}
1888 1888
 
1889 1889
 	/**
@@ -1911,9 +1911,9 @@  discard block
 block discarded – undo
1911 1911
 	private function setup_fees_total() {
1912 1912
 		$fees_total = (float) 0.00;
1913 1913
 
1914
-		$payment_fees = isset( $this->payment_meta['fees'] ) ? $this->payment_meta['fees'] : array();
1915
-		if ( ! empty( $payment_fees ) ) {
1916
-			foreach ( $payment_fees as $fee ) {
1914
+		$payment_fees = isset($this->payment_meta['fees']) ? $this->payment_meta['fees'] : array();
1915
+		if ( ! empty($payment_fees)) {
1916
+			foreach ($payment_fees as $fee) {
1917 1917
 				$fees_total += (float) $fee['amount'];
1918 1918
 			}
1919 1919
 		}
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
 	 * @return string The currency for the payment
1932 1932
 	 */
1933 1933
 	private function setup_currency() {
1934
-		$currency = isset( $this->payment_meta['currency'] ) ? $this->payment_meta['currency'] : apply_filters( 'give_payment_currency_default', give_get_currency(), $this );
1934
+		$currency = isset($this->payment_meta['currency']) ? $this->payment_meta['currency'] : apply_filters('give_payment_currency_default', give_get_currency(), $this);
1935 1935
 
1936 1936
 		return $currency;
1937 1937
 	}
@@ -1945,7 +1945,7 @@  discard block
 block discarded – undo
1945 1945
 	 * @return array The Fees
1946 1946
 	 */
1947 1947
 	private function setup_fees() {
1948
-		$payment_fees = isset( $this->payment_meta['fees'] ) ? $this->payment_meta['fees'] : array();
1948
+		$payment_fees = isset($this->payment_meta['fees']) ? $this->payment_meta['fees'] : array();
1949 1949
 
1950 1950
 		return $payment_fees;
1951 1951
 	}
@@ -1959,7 +1959,7 @@  discard block
 block discarded – undo
1959 1959
 	 * @return string The gateway
1960 1960
 	 */
1961 1961
 	private function setup_gateway() {
1962
-		$gateway = $this->get_meta( '_give_payment_gateway', true );
1962
+		$gateway = $this->get_meta('_give_payment_gateway', true);
1963 1963
 
1964 1964
 		return $gateway;
1965 1965
 	}
@@ -1973,11 +1973,11 @@  discard block
 block discarded – undo
1973 1973
 	 * @return string The donation ID
1974 1974
 	 */
1975 1975
 	private function setup_transaction_id() {
1976
-		$transaction_id = $this->get_meta( '_give_payment_transaction_id', true );
1976
+		$transaction_id = $this->get_meta('_give_payment_transaction_id', true);
1977 1977
 
1978
-		if ( empty( $transaction_id ) ) {
1978
+		if (empty($transaction_id)) {
1979 1979
 			$gateway        = $this->gateway;
1980
-			$transaction_id = apply_filters( "give_get_payment_transaction_id-{$gateway}", $this->ID );
1980
+			$transaction_id = apply_filters("give_get_payment_transaction_id-{$gateway}", $this->ID);
1981 1981
 		}
1982 1982
 
1983 1983
 		return $transaction_id;
@@ -1992,7 +1992,7 @@  discard block
 block discarded – undo
1992 1992
 	 * @return string The IP address for the payment
1993 1993
 	 */
1994 1994
 	private function setup_ip() {
1995
-		$ip = $this->get_meta( '_give_payment_user_ip', true );
1995
+		$ip = $this->get_meta('_give_payment_user_ip', true);
1996 1996
 
1997 1997
 		return $ip;
1998 1998
 	}
@@ -2006,7 +2006,7 @@  discard block
 block discarded – undo
2006 2006
 	 * @return int The Customer ID
2007 2007
 	 */
2008 2008
 	private function setup_customer_id() {
2009
-		$customer_id = $this->get_meta( '_give_payment_customer_id', true );
2009
+		$customer_id = $this->get_meta('_give_payment_customer_id', true);
2010 2010
 
2011 2011
 		return $customer_id;
2012 2012
 	}
@@ -2020,7 +2020,7 @@  discard block
 block discarded – undo
2020 2020
 	 * @return int The User ID
2021 2021
 	 */
2022 2022
 	private function setup_user_id() {
2023
-		$user_id = $this->get_meta( '_give_payment_user_id', true );
2023
+		$user_id = $this->get_meta('_give_payment_user_id', true);
2024 2024
 
2025 2025
 		return $user_id;
2026 2026
 	}
@@ -2034,10 +2034,10 @@  discard block
 block discarded – undo
2034 2034
 	 * @return string The email address for the payment
2035 2035
 	 */
2036 2036
 	private function setup_email() {
2037
-		$email = $this->get_meta( '_give_payment_user_email', true );
2037
+		$email = $this->get_meta('_give_payment_user_email', true);
2038 2038
 
2039
-		if ( empty( $email ) ) {
2040
-			$email = Give()->customers->get_column( 'email', $this->customer_id );
2039
+		if (empty($email)) {
2040
+			$email = Give()->customers->get_column('email', $this->customer_id);
2041 2041
 		}
2042 2042
 
2043 2043
 		return $email;
@@ -2057,15 +2057,15 @@  discard block
 block discarded – undo
2057 2057
 			'last_name'  => $this->last_name,
2058 2058
 		);
2059 2059
 
2060
-		$user_info = isset( $this->payment_meta['user_info'] ) ? maybe_unserialize( $this->payment_meta['user_info'] ) : array();
2061
-		$user_info = wp_parse_args( $user_info, $defaults );
2060
+		$user_info = isset($this->payment_meta['user_info']) ? maybe_unserialize($this->payment_meta['user_info']) : array();
2061
+		$user_info = wp_parse_args($user_info, $defaults);
2062 2062
 
2063
-		if ( empty( $user_info ) ) {
2063
+		if (empty($user_info)) {
2064 2064
 			// Get the customer, but only if it's been created.
2065
-			$customer = new Give_Customer( $this->customer_id );
2065
+			$customer = new Give_Customer($this->customer_id);
2066 2066
 
2067
-			if ( $customer->id > 0 ) {
2068
-				$name      = explode( ' ', $customer->name, 2 );
2067
+			if ($customer->id > 0) {
2068
+				$name      = explode(' ', $customer->name, 2);
2069 2069
 				$user_info = array(
2070 2070
 					'first_name' => $name[0],
2071 2071
 					'last_name'  => $name[1],
@@ -2075,29 +2075,29 @@  discard block
 block discarded – undo
2075 2075
 			}
2076 2076
 		} else {
2077 2077
 			// Get the customer, but only if it's been created.
2078
-			$customer = new Give_Customer( $this->customer_id );
2079
-			if ( $customer->id > 0 ) {
2080
-				foreach ( $user_info as $key => $value ) {
2081
-					if ( ! empty( $value ) ) {
2078
+			$customer = new Give_Customer($this->customer_id);
2079
+			if ($customer->id > 0) {
2080
+				foreach ($user_info as $key => $value) {
2081
+					if ( ! empty($value)) {
2082 2082
 						continue;
2083 2083
 					}
2084 2084
 
2085
-					switch ( $key ) {
2085
+					switch ($key) {
2086 2086
 						case 'first_name':
2087
-							$name = explode( ' ', $customer->name, 2 );
2087
+							$name = explode(' ', $customer->name, 2);
2088 2088
 
2089
-							$user_info[ $key ] = $name[0];
2089
+							$user_info[$key] = $name[0];
2090 2090
 							break;
2091 2091
 
2092 2092
 						case 'last_name':
2093
-							$name      = explode( ' ', $customer->name, 2 );
2094
-							$last_name = ! empty( $name[1] ) ? $name[1] : '';
2093
+							$name      = explode(' ', $customer->name, 2);
2094
+							$last_name = ! empty($name[1]) ? $name[1] : '';
2095 2095
 
2096
-							$user_info[ $key ] = $last_name;
2096
+							$user_info[$key] = $last_name;
2097 2097
 							break;
2098 2098
 
2099 2099
 						case 'email':
2100
-							$user_info[ $key ] = $customer->email;
2100
+							$user_info[$key] = $customer->email;
2101 2101
 							break;
2102 2102
 					}
2103 2103
 				}
@@ -2118,7 +2118,7 @@  discard block
 block discarded – undo
2118 2118
 	 */
2119 2119
 	private function setup_address() {
2120 2120
 
2121
-		$address = ! empty( $this->payment_meta['user_info']['address'] ) ? $this->payment_meta['user_info']['address'] : array(
2121
+		$address = ! empty($this->payment_meta['user_info']['address']) ? $this->payment_meta['user_info']['address'] : array(
2122 2122
 			'line1'   => '',
2123 2123
 			'line2'   => '',
2124 2124
 			'city'    => '',
@@ -2140,7 +2140,7 @@  discard block
 block discarded – undo
2140 2140
 	 */
2141 2141
 	private function setup_form_title() {
2142 2142
 
2143
-		$form_id = $this->get_meta( '_give_payment_form_title', true );
2143
+		$form_id = $this->get_meta('_give_payment_form_title', true);
2144 2144
 
2145 2145
 		return $form_id;
2146 2146
 	}
@@ -2155,7 +2155,7 @@  discard block
 block discarded – undo
2155 2155
 	 */
2156 2156
 	private function setup_form_id() {
2157 2157
 
2158
-		$form_id = $this->get_meta( '_give_payment_form_id', true );
2158
+		$form_id = $this->get_meta('_give_payment_form_id', true);
2159 2159
 
2160 2160
 		return $form_id;
2161 2161
 	}
@@ -2169,7 +2169,7 @@  discard block
 block discarded – undo
2169 2169
 	 * @return int The Form Price ID
2170 2170
 	 */
2171 2171
 	private function setup_price_id() {
2172
-		$price_id = $this->get_meta( '_give_payment_price_id', true );
2172
+		$price_id = $this->get_meta('_give_payment_price_id', true);
2173 2173
 
2174 2174
 		return $price_id;
2175 2175
 	}
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
 	 * @return string The Payment Key
2184 2184
 	 */
2185 2185
 	private function setup_payment_key() {
2186
-		$key = $this->get_meta( '_give_payment_purchase_key', true );
2186
+		$key = $this->get_meta('_give_payment_purchase_key', true);
2187 2187
 
2188 2188
 		return $key;
2189 2189
 	}
@@ -2199,11 +2199,11 @@  discard block
 block discarded – undo
2199 2199
 	private function setup_payment_number() {
2200 2200
 		$number = $this->ID;
2201 2201
 
2202
-		if ( give_get_option( 'enable_sequential' ) ) {
2202
+		if (give_get_option('enable_sequential')) {
2203 2203
 
2204
-			$number = $this->get_meta( '_give_payment_number', true );
2204
+			$number = $this->get_meta('_give_payment_number', true);
2205 2205
 
2206
-			if ( ! $number ) {
2206
+			if ( ! $number) {
2207 2207
 
2208 2208
 				$number = $this->ID;
2209 2209
 
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 	 * @return array The payment object as an array
2222 2222
 	 */
2223 2223
 	public function array_convert() {
2224
-		return get_object_vars( $this );
2224
+		return get_object_vars($this);
2225 2225
 	}
2226 2226
 
2227 2227
 
@@ -2234,7 +2234,7 @@  discard block
 block discarded – undo
2234 2234
 	 * @return bool
2235 2235
 	 */
2236 2236
 	public function is_completed() {
2237
-		return ( 'publish' === $this->status && $this->completed_date );
2237
+		return ('publish' === $this->status && $this->completed_date);
2238 2238
 	}
2239 2239
 
2240 2240
 	/**
@@ -2246,7 +2246,7 @@  discard block
 block discarded – undo
2246 2246
 	 * @return string Date payment was completed
2247 2247
 	 */
2248 2248
 	private function get_completed_date() {
2249
-		return apply_filters( 'give_payment_completed_date', $this->completed_date, $this->ID, $this );
2249
+		return apply_filters('give_payment_completed_date', $this->completed_date, $this->ID, $this);
2250 2250
 	}
2251 2251
 
2252 2252
 	/**
@@ -2258,7 +2258,7 @@  discard block
 block discarded – undo
2258 2258
 	 * @return float Payment subtotal
2259 2259
 	 */
2260 2260
 	private function get_subtotal() {
2261
-		return apply_filters( 'give_get_payment_subtotal', $this->subtotal, $this->ID, $this );
2261
+		return apply_filters('give_get_payment_subtotal', $this->subtotal, $this->ID, $this);
2262 2262
 	}
2263 2263
 
2264 2264
 	/**
@@ -2270,7 +2270,7 @@  discard block
 block discarded – undo
2270 2270
 	 * @return string Payment currency code
2271 2271
 	 */
2272 2272
 	private function get_currency() {
2273
-		return apply_filters( 'give_payment_currency_code', $this->currency, $this->ID, $this );
2273
+		return apply_filters('give_payment_currency_code', $this->currency, $this->ID, $this);
2274 2274
 	}
2275 2275
 
2276 2276
 	/**
@@ -2282,7 +2282,7 @@  discard block
 block discarded – undo
2282 2282
 	 * @return string Gateway used
2283 2283
 	 */
2284 2284
 	private function get_gateway() {
2285
-		return apply_filters( 'give_payment_gateway', $this->gateway, $this->ID, $this );
2285
+		return apply_filters('give_payment_gateway', $this->gateway, $this->ID, $this);
2286 2286
 	}
2287 2287
 
2288 2288
 	/**
@@ -2294,7 +2294,7 @@  discard block
 block discarded – undo
2294 2294
 	 * @return string Donation ID from merchant processor
2295 2295
 	 */
2296 2296
 	private function get_transaction_id() {
2297
-		return apply_filters( 'give_get_payment_transaction_id', $this->transaction_id, $this->ID, $this );
2297
+		return apply_filters('give_get_payment_transaction_id', $this->transaction_id, $this->ID, $this);
2298 2298
 	}
2299 2299
 
2300 2300
 	/**
@@ -2306,7 +2306,7 @@  discard block
 block discarded – undo
2306 2306
 	 * @return string Payment IP address
2307 2307
 	 */
2308 2308
 	private function get_ip() {
2309
-		return apply_filters( 'give_payment_user_ip', $this->ip, $this->ID, $this );
2309
+		return apply_filters('give_payment_user_ip', $this->ip, $this->ID, $this);
2310 2310
 	}
2311 2311
 
2312 2312
 	/**
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
 	 * @return int Payment customer ID
2319 2319
 	 */
2320 2320
 	private function get_customer_id() {
2321
-		return apply_filters( 'give_payment_customer_id', $this->customer_id, $this->ID, $this );
2321
+		return apply_filters('give_payment_customer_id', $this->customer_id, $this->ID, $this);
2322 2322
 	}
2323 2323
 
2324 2324
 	/**
@@ -2330,7 +2330,7 @@  discard block
 block discarded – undo
2330 2330
 	 * @return int Payment user ID
2331 2331
 	 */
2332 2332
 	private function get_user_id() {
2333
-		return apply_filters( 'give_payment_user_id', $this->user_id, $this->ID, $this );
2333
+		return apply_filters('give_payment_user_id', $this->user_id, $this->ID, $this);
2334 2334
 	}
2335 2335
 
2336 2336
 	/**
@@ -2342,7 +2342,7 @@  discard block
 block discarded – undo
2342 2342
 	 * @return string Payment customer email
2343 2343
 	 */
2344 2344
 	private function get_email() {
2345
-		return apply_filters( 'give_payment_user_email', $this->email, $this->ID, $this );
2345
+		return apply_filters('give_payment_user_email', $this->email, $this->ID, $this);
2346 2346
 	}
2347 2347
 
2348 2348
 	/**
@@ -2354,7 +2354,7 @@  discard block
 block discarded – undo
2354 2354
 	 * @return array Payment user info
2355 2355
 	 */
2356 2356
 	private function get_user_info() {
2357
-		return apply_filters( 'give_payment_meta_user_info', $this->user_info, $this->ID, $this );
2357
+		return apply_filters('give_payment_meta_user_info', $this->user_info, $this->ID, $this);
2358 2358
 	}
2359 2359
 
2360 2360
 	/**
@@ -2366,7 +2366,7 @@  discard block
 block discarded – undo
2366 2366
 	 * @return array Payment billing address
2367 2367
 	 */
2368 2368
 	private function get_address() {
2369
-		return apply_filters( 'give_payment_address', $this->address, $this->ID, $this );
2369
+		return apply_filters('give_payment_address', $this->address, $this->ID, $this);
2370 2370
 	}
2371 2371
 
2372 2372
 	/**
@@ -2378,7 +2378,7 @@  discard block
 block discarded – undo
2378 2378
 	 * @return string Payment key
2379 2379
 	 */
2380 2380
 	private function get_key() {
2381
-		return apply_filters( 'give_payment_key', $this->key, $this->ID, $this );
2381
+		return apply_filters('give_payment_key', $this->key, $this->ID, $this);
2382 2382
 	}
2383 2383
 
2384 2384
 	/**
@@ -2390,7 +2390,7 @@  discard block
 block discarded – undo
2390 2390
 	 * @return string Payment form id
2391 2391
 	 */
2392 2392
 	private function get_form_id() {
2393
-		return apply_filters( 'give_payment_form_id', $this->form_id, $this->ID, $this );
2393
+		return apply_filters('give_payment_form_id', $this->form_id, $this->ID, $this);
2394 2394
 	}
2395 2395
 
2396 2396
 	/**
@@ -2402,7 +2402,7 @@  discard block
 block discarded – undo
2402 2402
 	 * @return int|string Payment number
2403 2403
 	 */
2404 2404
 	private function get_number() {
2405
-		return apply_filters( 'give_payment_number', $this->number, $this->ID, $this );
2405
+		return apply_filters('give_payment_number', $this->number, $this->ID, $this);
2406 2406
 	}
2407 2407
 
2408 2408
 }
Please login to merge, or discard this patch.
includes/class-give-cron.php 1 patch
Spacing   +9 added lines, -9 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
 
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * @see    Give_Cron::weekly_events()
35 35
 	 */
36 36
 	public function __construct() {
37
-		add_filter( 'cron_schedules', array( $this, 'add_schedules' ) );
38
-		add_action( 'wp', array( $this, 'schedule_Events' ) );
37
+		add_filter('cron_schedules', array($this, 'add_schedules'));
38
+		add_action('wp', array($this, 'schedule_Events'));
39 39
 	}
40 40
 
41 41
 	/**
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	 *
49 49
 	 * @return array            An array of non-default cron schedules.
50 50
 	 */
51
-	public function add_schedules( $schedules = array() ) {
51
+	public function add_schedules($schedules = array()) {
52 52
 		// Adds once weekly to the existing schedules.
53 53
 		$schedules['weekly'] = array(
54 54
 			'interval' => 604800,
55
-			'display'  => esc_html__( 'Once Weekly', 'give' )
55
+			'display'  => esc_html__('Once Weekly', 'give')
56 56
 		);
57 57
 
58 58
 		return $schedules;
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	 * @return void
81 81
 	 */
82 82
 	private function weekly_events() {
83
-		if ( ! wp_next_scheduled( 'give_weekly_scheduled_events' ) ) {
84
-			wp_schedule_event( current_time( 'timestamp' ), 'weekly', 'give_weekly_scheduled_events' );
83
+		if ( ! wp_next_scheduled('give_weekly_scheduled_events')) {
84
+			wp_schedule_event(current_time('timestamp'), 'weekly', 'give_weekly_scheduled_events');
85 85
 		}
86 86
 	}
87 87
 
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 	 * @return void
95 95
 	 */
96 96
 	private function daily_events() {
97
-		if ( ! wp_next_scheduled( 'give_daily_scheduled_events' ) ) {
98
-			wp_schedule_event( current_time( 'timestamp' ), 'daily', 'give_daily_scheduled_events' );
97
+		if ( ! wp_next_scheduled('give_daily_scheduled_events')) {
98
+			wp_schedule_event(current_time('timestamp'), 'daily', 'give_daily_scheduled_events');
99 99
 		}
100 100
 	}
101 101
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-display.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 								'disabled' => __( 'Disabled', 'give' ),
88 88
 							)
89 89
 						),
90
-                        array(
91
-                            'name'  => esc_html__( 'Display Settings Docs Link', 'give' ),
92
-                            'id'    => 'display_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
94
-                            'title' => __( 'Display Options Settings', 'give' ),
95
-                            'type'  => 'give_docs_link',
96
-                        ),
90
+						array(
91
+							'name'  => esc_html__( 'Display Settings Docs Link', 'give' ),
92
+							'id'    => 'display_settings_docs_link',
93
+							'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
94
+							'title' => __( 'Display Options Settings', 'give' ),
95
+							'type'  => 'give_docs_link',
96
+						),
97 97
 						array(
98 98
 							'id'   => 'give_title_display_settings_1',
99 99
 							'type' => 'sectionend'
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
 								'disabled' => __( 'Disabled', 'give' ),
171 171
 							)
172 172
 						),
173
-                        array(
174
-                            'name'  => esc_html__( 'Post Types Docs Link', 'give' ),
175
-                            'id'    => 'post_types_settings_docs_link',
176
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
177
-                            'title' => __( 'Post Types Settings', 'give' ),
178
-                            'type'  => 'give_docs_link',
179
-                        ),
173
+						array(
174
+							'name'  => esc_html__( 'Post Types Docs Link', 'give' ),
175
+							'id'    => 'post_types_settings_docs_link',
176
+							'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
177
+							'title' => __( 'Post Types Settings', 'give' ),
178
+							'type'  => 'give_docs_link',
179
+						),
180 180
 						array(
181 181
 							'id'   => 'give_title_display_settings_2',
182 182
 							'type' => 'sectionend'
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 								'disabled' => __( 'Disabled', 'give' ),
213 213
 							)
214 214
 						),
215
-                        array(
216
-                            'name'  => esc_html__( 'Taxonomies Docs Link', 'give' ),
217
-                            'id'    => 'taxonomies_settings_docs_link',
218
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
219
-                            'title' => __( 'Taxonomies Settings', 'give' ),
220
-                            'type'  => 'give_docs_link',
221
-                        ),
215
+						array(
216
+							'name'  => esc_html__( 'Taxonomies Docs Link', 'give' ),
217
+							'id'    => 'taxonomies_settings_docs_link',
218
+							'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
219
+							'title' => __( 'Taxonomies Settings', 'give' ),
220
+							'type'  => 'give_docs_link',
221
+						),
222 222
 						array(
223 223
 							'id'   => 'give_title_display_settings_3',
224 224
 							'type' => 'sectionend'
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
 							'id'   => 'agreement_text',
259 259
 							'type' => 'wysiwyg'
260 260
 						),
261
-                        array(
262
-                            'name'  => esc_html__( 'Terms and Conditions Docs Link', 'give' ),
263
-                            'id'    => 'terms_settings_docs_link',
264
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
265
-                            'title' => __( 'Terms and Conditions Settings', 'give' ),
266
-                            'type'  => 'give_docs_link',
267
-                        ),
261
+						array(
262
+							'name'  => esc_html__( 'Terms and Conditions Docs Link', 'give' ),
263
+							'id'    => 'terms_settings_docs_link',
264
+							'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
265
+							'title' => __( 'Terms and Conditions Settings', 'give' ),
266
+							'type'  => 'give_docs_link',
267
+						),
268 268
 						array(
269 269
 							'id'   => 'give_title_display_settings_4',
270 270
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Display' ) ) :
16
+if ( ! class_exists('Give_Settings_Display')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Display.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'display';
30
-			$this->label = esc_html__( 'Display Options', 'give' );
30
+			$this->label = esc_html__('Display Options', 'give');
31 31
 
32 32
 			$this->default_tab = 'display-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'display-settings' :
49 49
 					$settings = array(
50 50
 						// Section 1: Display
@@ -53,45 +53,45 @@  discard block
 block discarded – undo
53 53
 							'type' => 'title'
54 54
 						),
55 55
 						array(
56
-							'name'    => esc_html__( 'Default Give Styles', 'give' ),
57
-							'desc'    => esc_html__( 'You can disable Give\'s default styles for donation forms and other frontend elements.', 'give' ),
56
+							'name'    => esc_html__('Default Give Styles', 'give'),
57
+							'desc'    => esc_html__('You can disable Give\'s default styles for donation forms and other frontend elements.', 'give'),
58 58
 							'id'      => 'css',
59 59
 							'type'    => 'radio_inline',
60 60
 							'default' => 'enabled',
61 61
 							'options' => array(
62
-								'enabled' => __( 'Enabled', 'give' ),
63
-								'disabled' => __( 'Disabled', 'give' ),
62
+								'enabled' => __('Enabled', 'give'),
63
+								'disabled' => __('Disabled', 'give'),
64 64
 							)
65 65
 						),
66 66
 						array(
67
-							'name' => esc_html__( 'Floating Labels', 'give' ),
67
+							'name' => esc_html__('Floating Labels', 'give'),
68 68
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
69
-							'desc' => sprintf( wp_kses( __( '<a href="%s" target="_blank">Floating labels</a> allows your lables to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
69
+							'desc' => sprintf(wp_kses(__('<a href="%s" target="_blank">Floating labels</a> allows your lables to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url('http://docs.givewp.com/form-floating-labels')),
70 70
 							'id'   => 'floatlabels',
71 71
 							'type'    => 'radio_inline',
72 72
 							'default' => 'disabled',
73 73
 							'options' => array(
74
-								'enabled' => __( 'Enabled', 'give' ),
75
-								'disabled' => __( 'Disabled', 'give' ),
74
+								'enabled' => __('Enabled', 'give'),
75
+								'disabled' => __('Disabled', 'give'),
76 76
 							)
77 77
 						),
78 78
 						array(
79
-							'name'    => esc_html__( 'Welcome Screen', 'give' ),
79
+							'name'    => esc_html__('Welcome Screen', 'give'),
80 80
 							/* translators: %s: about page URL */
81
-							'desc'    => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
81
+							'desc'    => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url(admin_url('index.php?page=give-about'))),
82 82
 							'id'      => 'welcome',
83 83
 							'type'    => 'radio_inline',
84 84
 							'default' => 'enabled',
85 85
 							'options' => array(
86
-								'enabled' => __( 'Enabled', 'give' ),
87
-								'disabled' => __( 'Disabled', 'give' ),
86
+								'enabled' => __('Enabled', 'give'),
87
+								'disabled' => __('Disabled', 'give'),
88 88
 							)
89 89
 						),
90 90
                         array(
91
-                            'name'  => esc_html__( 'Display Settings Docs Link', 'give' ),
91
+                            'name'  => esc_html__('Display Settings Docs Link', 'give'),
92 92
                             'id'    => 'display_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
94
-                            'title' => __( 'Display Options Settings', 'give' ),
93
+                            'url'   => esc_url('http://docs.givewp.com/form-display-options'),
94
+                            'title' => __('Display Options Settings', 'give'),
95 95
                             'type'  => 'give_docs_link',
96 96
                         ),
97 97
 						array(
@@ -108,73 +108,73 @@  discard block
 block discarded – undo
108 108
 							'type' => 'title'
109 109
 						),
110 110
 						array(
111
-							'name'    => esc_html__( 'Form Single Views', 'give' ),
112
-							'desc'    => esc_html__( 'By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
111
+							'name'    => esc_html__('Form Single Views', 'give'),
112
+							'desc'    => esc_html__('By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
113 113
 							'id'      => 'forms_singular',
114 114
 							'type'    => 'radio_inline',
115 115
 							'default' => 'enabled',
116 116
 							'options' => array(
117
-								'enabled' => __( 'Enabled', 'give' ),
118
-								'disabled' => __( 'Disabled', 'give' ),
117
+								'enabled' => __('Enabled', 'give'),
118
+								'disabled' => __('Disabled', 'give'),
119 119
 							)
120 120
 						),
121 121
 						array(
122
-							'name'    => esc_html__( 'Form Archives', 'give' ),
123
-							'desc'    => sprintf( wp_kses( __( 'Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( admin_url( 'options-permalink.php' ) ) ),
122
+							'name'    => esc_html__('Form Archives', 'give'),
123
+							'desc'    => sprintf(wp_kses(__('Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url(admin_url('options-permalink.php'))),
124 124
 							'id'      => 'forms_archives',
125 125
 							'type'    => 'radio_inline',
126 126
 							'default' => 'enabled',
127 127
 							'options' => array(
128
-								'enabled' => __( 'Enabled', 'give' ),
129
-								'disabled' => __( 'Disabled', 'give' ),
128
+								'enabled' => __('Enabled', 'give'),
129
+								'disabled' => __('Disabled', 'give'),
130 130
 							)
131 131
 						),
132 132
 						array(
133
-							'name'    => esc_html__( 'Form Excerpts', 'give' ),
134
-							'desc'    => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
133
+							'name'    => esc_html__('Form Excerpts', 'give'),
134
+							'desc'    => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
135 135
 							'id'      => 'forms_excerpt',
136 136
 							'type'    => 'radio_inline',
137 137
 							'default' => 'enabled',
138 138
 							'options' => array(
139
-								'enabled' => __( 'Enabled', 'give' ),
140
-								'disabled' => __( 'Disabled', 'give' ),
139
+								'enabled' => __('Enabled', 'give'),
140
+								'disabled' => __('Disabled', 'give'),
141 141
 							)
142 142
 						),
143 143
 						array(
144
-							'name'    => esc_html__( 'Form Featured Image', 'give' ),
145
-							'desc'    => esc_html__( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
144
+							'name'    => esc_html__('Form Featured Image', 'give'),
145
+							'desc'    => esc_html__('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
146 146
 							'id'      => 'form_featured_img',
147 147
 							'type'    => 'radio_inline',
148 148
 							'default' => 'enabled',
149 149
 							'options' => array(
150
-								'enabled' => __( 'Enabled', 'give' ),
151
-								'disabled' => __( 'Disabled', 'give' ),
150
+								'enabled' => __('Enabled', 'give'),
151
+								'disabled' => __('Disabled', 'give'),
152 152
 							)
153 153
 						),
154 154
 						array(
155
-							'name'    => esc_html__( 'Featured Image Size', 'give' ),
156
-							'desc'    => esc_html__( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
155
+							'name'    => esc_html__('Featured Image Size', 'give'),
156
+							'desc'    => esc_html__('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
157 157
 							'id'      => 'featured_image_size',
158 158
 							'type'    => 'select',
159 159
 							'default' => 'large',
160 160
 							'options' => give_get_featured_image_sizes()
161 161
 						),
162 162
 						array(
163
-							'name'    => esc_html__( 'Single Form Sidebar', 'give' ),
164
-							'desc'    => esc_html__( 'The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
163
+							'name'    => esc_html__('Single Form Sidebar', 'give'),
164
+							'desc'    => esc_html__('The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
165 165
 							'id'      => 'form_sidebar',
166 166
 							'type'    => 'radio_inline',
167 167
 							'default' => 'enabled',
168 168
 							'options' => array(
169
-								'enabled' => __( 'Enabled', 'give' ),
170
-								'disabled' => __( 'Disabled', 'give' ),
169
+								'enabled' => __('Enabled', 'give'),
170
+								'disabled' => __('Disabled', 'give'),
171 171
 							)
172 172
 						),
173 173
                         array(
174
-                            'name'  => esc_html__( 'Post Types Docs Link', 'give' ),
174
+                            'name'  => esc_html__('Post Types Docs Link', 'give'),
175 175
                             'id'    => 'post_types_settings_docs_link',
176
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
177
-                            'title' => __( 'Post Types Settings', 'give' ),
176
+                            'url'   => esc_url('http://docs.givewp.com/settings-post-types'),
177
+                            'title' => __('Post Types Settings', 'give'),
178 178
                             'type'  => 'give_docs_link',
179 179
                         ),
180 180
 						array(
@@ -191,32 +191,32 @@  discard block
 block discarded – undo
191 191
 							'type' => 'title'
192 192
 						),
193 193
 						array(
194
-							'name' => esc_html__( 'Form Categories', 'give' ),
195
-							'desc' => esc_html__( 'Enable Categories for all Give forms.', 'give' ),
194
+							'name' => esc_html__('Form Categories', 'give'),
195
+							'desc' => esc_html__('Enable Categories for all Give forms.', 'give'),
196 196
 							'id'   => 'categories',
197 197
 							'type'    => 'radio_inline',
198 198
 							'default' => 'disabled',
199 199
 							'options' => array(
200
-								'enabled' => __( 'Enabled', 'give' ),
201
-								'disabled' => __( 'Disabled', 'give' ),
200
+								'enabled' => __('Enabled', 'give'),
201
+								'disabled' => __('Disabled', 'give'),
202 202
 							)
203 203
 						),
204 204
 						array(
205
-							'name' => esc_html__( 'Form Tags', 'give' ),
206
-							'desc' => esc_html__( 'Enable Tags for all Give forms.', 'give' ),
205
+							'name' => esc_html__('Form Tags', 'give'),
206
+							'desc' => esc_html__('Enable Tags for all Give forms.', 'give'),
207 207
 							'id'   => 'tags',
208 208
 							'type'    => 'radio_inline',
209 209
 							'default' => 'disabled',
210 210
 							'options' => array(
211
-								'enabled' => __( 'Enabled', 'give' ),
212
-								'disabled' => __( 'Disabled', 'give' ),
211
+								'enabled' => __('Enabled', 'give'),
212
+								'disabled' => __('Disabled', 'give'),
213 213
 							)
214 214
 						),
215 215
                         array(
216
-                            'name'  => esc_html__( 'Taxonomies Docs Link', 'give' ),
216
+                            'name'  => esc_html__('Taxonomies Docs Link', 'give'),
217 217
                             'id'    => 'taxonomies_settings_docs_link',
218
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
219
-                            'title' => __( 'Taxonomies Settings', 'give' ),
218
+                            'url'   => esc_url('http://docs.givewp.com/settings-taxonomies'),
219
+                            'title' => __('Taxonomies Settings', 'give'),
220 220
                             'type'  => 'give_docs_link',
221 221
                         ),
222 222
 						array(
@@ -233,36 +233,36 @@  discard block
 block discarded – undo
233 233
 							'type' => 'title'
234 234
 						),
235 235
 						array(
236
-							'name'    => esc_html__( 'Terms and Conditions', 'give' ),
237
-							'desc'    => esc_html__( 'Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give' ),
236
+							'name'    => esc_html__('Terms and Conditions', 'give'),
237
+							'desc'    => esc_html__('Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give'),
238 238
 							'id'      => 'terms',
239 239
 							'type'    => 'radio_inline',
240 240
 							'default' => 'disabled',
241 241
 							'options' => array(
242
-								'enabled' => __( 'Enabled', 'give' ),
243
-								'disabled' => __( 'Disabled', 'give' ),
242
+								'enabled' => __('Enabled', 'give'),
243
+								'disabled' => __('Disabled', 'give'),
244 244
 							)
245 245
 						),
246 246
 						array(
247
-							'name' => esc_html__( 'Agree to Terms Label', 'give' ),
248
-							'desc' => esc_html__( 'The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give' ),
247
+							'name' => esc_html__('Agree to Terms Label', 'give'),
248
+							'desc' => esc_html__('The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give'),
249 249
 							'id'   => 'agree_to_terms_label',
250 250
 							'attributes'  => array(
251
-								'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
251
+								'placeholder' => esc_attr__('Agree to Terms?', 'give'),
252 252
 							),
253 253
 							'type' => 'text'
254 254
 						),
255 255
 						array(
256
-							'name' => esc_html__( 'Agreement Text', 'give' ),
257
-							'desc' => esc_html__( 'This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give' ),
256
+							'name' => esc_html__('Agreement Text', 'give'),
257
+							'desc' => esc_html__('This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give'),
258 258
 							'id'   => 'agreement_text',
259 259
 							'type' => 'wysiwyg'
260 260
 						),
261 261
                         array(
262
-                            'name'  => esc_html__( 'Terms and Conditions Docs Link', 'give' ),
262
+                            'name'  => esc_html__('Terms and Conditions Docs Link', 'give'),
263 263
                             'id'    => 'terms_settings_docs_link',
264
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
265
-                            'title' => __( 'Terms and Conditions Settings', 'give' ),
264
+                            'url'   => esc_url('http://docs.givewp.com/settings-terms'),
265
+                            'title' => __('Terms and Conditions Settings', 'give'),
266 266
                             'type'  => 'give_docs_link',
267 267
                         ),
268 268
 						array(
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 			 * Filter the display options settings.
278 278
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
279 279
 			 */
280
-			$settings = apply_filters( 'give_settings_display', $settings );
280
+			$settings = apply_filters('give_settings_display', $settings);
281 281
 
282 282
 			/**
283 283
 			 * Filter the settings.
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 			 * @since  1.8
286 286
 			 * @param  array $settings
287 287
 			 */
288
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
288
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
289 289
 
290 290
 			// Output.
291 291
 			return $settings;
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 		 */
300 300
 		public function get_sections() {
301 301
 			$sections = array(
302
-				'display-settings'    => esc_html__( 'Display', 'give' ),
303
-				'post-types'          => esc_html__( 'Post Types', 'give' ),
304
-				'taxonomies'          => esc_html__( 'Taxonomies', 'give' ),
305
-				'term-and-conditions' => esc_html__( 'Terms and Conditions', 'give' )
302
+				'display-settings'    => esc_html__('Display', 'give'),
303
+				'post-types'          => esc_html__('Post Types', 'give'),
304
+				'taxonomies'          => esc_html__('Taxonomies', 'give'),
305
+				'term-and-conditions' => esc_html__('Terms and Conditions', 'give')
306 306
 			);
307 307
 
308
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
308
+			return apply_filters('give_get_sections_'.$this->id, $sections);
309 309
 		}
310 310
 	}
311 311
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-email.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 							'default' => get_bloginfo( 'admin_email' ),
80 80
 							'type'    => 'text'
81 81
 						),
82
-                        array(
83
-                            'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
84
-                            'id'    => 'email_settings_docs_link',
85
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
-                            'title' => __( 'Email Settings', 'give' ),
87
-                            'type'  => 'give_docs_link',
88
-                        ),
82
+						array(
83
+							'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
84
+							'id'    => 'email_settings_docs_link',
85
+							'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
+							'title' => __( 'Email Settings', 'give' ),
87
+							'type'  => 'give_docs_link',
88
+						),
89 89
 						array(
90 90
 							'id'   => 'give_title_email_settings_1',
91 91
 							'type' => 'sectionend'
@@ -118,13 +118,13 @@  discard block
 block discarded – undo
118 118
 							'type'    => 'wysiwyg',
119 119
 							'default' => give_get_default_donation_receipt_email()
120 120
 						),
121
-                        array(
122
-                            'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
123
-                            'id'    => 'donation_receipt_settings_docs_link',
124
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
-                            'title' => __( 'Donation Receipt Settings', 'give' ),
126
-                            'type'  => 'give_docs_link',
127
-                        ),
121
+						array(
122
+							'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
123
+							'id'    => 'donation_receipt_settings_docs_link',
124
+							'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
+							'title' => __( 'Donation Receipt Settings', 'give' ),
126
+							'type'  => 'give_docs_link',
127
+						),
128 128
 						array(
129 129
 							'id'   => 'give_title_email_settings_2',
130 130
 							'type' => 'sectionend'
@@ -175,13 +175,13 @@  discard block
 block discarded – undo
175 175
 							'type'    => 'textarea',
176 176
 							'default' => get_bloginfo( 'admin_email' )
177 177
 						),
178
-                        array(
179
-                            'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
180
-                            'id'    => 'donation_notification_settings_docs_link',
181
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
-                            'title' => __( 'Donation Notification Settings', 'give' ),
183
-                            'type'  => 'give_docs_link',
184
-                        ),
178
+						array(
179
+							'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
180
+							'id'    => 'donation_notification_settings_docs_link',
181
+							'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
+							'title' => __( 'Donation Notification Settings', 'give' ),
183
+							'type'  => 'give_docs_link',
184
+						),
185 185
 						array(
186 186
 							'id'   => 'give_title_email_settings_3',
187 187
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Email' ) ) :
16
+if ( ! class_exists('Give_Settings_Email')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Email.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'emails';
30
-			$this->label = esc_html__( 'Emails', 'give' );
30
+			$this->label = esc_html__('Emails', 'give');
31 31
 
32 32
 			$this->default_tab = 'email-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'email-settings' :
49 49
 					$settings = array(
50 50
 						// Section 1: Email
@@ -54,36 +54,36 @@  discard block
 block discarded – undo
54 54
 						),
55 55
 						array(
56 56
 							'id'      => 'email_template',
57
-							'name'    => esc_html__( 'Email Template', 'give' ),
58
-							'desc'    => esc_html__( 'Choose your template from the available registered template types.', 'give' ),
57
+							'name'    => esc_html__('Email Template', 'give'),
58
+							'desc'    => esc_html__('Choose your template from the available registered template types.', 'give'),
59 59
 							'type'    => 'select',
60 60
 							'options' => give_get_email_templates()
61 61
 						),
62 62
 						array(
63 63
 							'id'   => 'email_logo',
64
-							'name' => esc_html__( 'Logo', 'give' ),
65
-							'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
64
+							'name' => esc_html__('Logo', 'give'),
65
+							'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
66 66
 							'type' => 'file'
67 67
 						),
68 68
 						array(
69 69
 							'id'      => 'from_name',
70
-							'name'    => esc_html__( 'From Name', 'give' ),
71
-							'desc'    => esc_html__( 'The name which appears in the "From" field in all Give donation emails.', 'give' ),
72
-							'default' => get_bloginfo( 'name' ),
70
+							'name'    => esc_html__('From Name', 'give'),
71
+							'desc'    => esc_html__('The name which appears in the "From" field in all Give donation emails.', 'give'),
72
+							'default' => get_bloginfo('name'),
73 73
 							'type'    => 'text'
74 74
 						),
75 75
 						array(
76 76
 							'id'      => 'from_email',
77
-							'name'    => esc_html__( 'From Email', 'give' ),
78
-							'desc'    => esc_html__( 'Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give' ),
79
-							'default' => get_bloginfo( 'admin_email' ),
77
+							'name'    => esc_html__('From Email', 'give'),
78
+							'desc'    => esc_html__('Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give'),
79
+							'default' => get_bloginfo('admin_email'),
80 80
 							'type'    => 'text'
81 81
 						),
82 82
                         array(
83
-                            'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
83
+                            'name'  => esc_html__('Email Settings Docs Link', 'give'),
84 84
                             'id'    => 'email_settings_docs_link',
85
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
-                            'title' => __( 'Email Settings', 'give' ),
85
+                            'url'   => esc_url('http://docs.givewp.com/settings-emails'),
86
+                            'title' => __('Email Settings', 'give'),
87 87
                             'type'  => 'give_docs_link',
88 88
                         ),
89 89
 						array(
@@ -102,27 +102,27 @@  discard block
 block discarded – undo
102 102
 						),
103 103
 						array(
104 104
 							'id'      => 'donation_subject',
105
-							'name'    => esc_html__( 'Donation Email Subject', 'give' ),
106
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
107
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
105
+							'name'    => esc_html__('Donation Email Subject', 'give'),
106
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
107
+							'default' => esc_attr__('Donation Receipt', 'give'),
108 108
 							'type'    => 'text'
109 109
 						),
110 110
 						array(
111 111
 							'id'      => 'donation_receipt',
112
-							'name'    => esc_html__( 'Donation Receipt', 'give' ),
112
+							'name'    => esc_html__('Donation Receipt', 'give'),
113 113
 							'desc'    => sprintf(
114 114
 							/* translators: %s: emails tags list */
115
-								__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted.<br /><strong>Available template tags:</strong> %s', 'give' ),
115
+								__('Enter the email that is sent to users after completing a successful donation. HTML is accepted.<br /><strong>Available template tags:</strong> %s', 'give'),
116 116
 								'<br/>'.give_get_emails_tags_list()
117 117
 							),
118 118
 							'type'    => 'wysiwyg',
119 119
 							'default' => give_get_default_donation_receipt_email()
120 120
 						),
121 121
                         array(
122
-                            'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
122
+                            'name'  => esc_html__('Donation Receipt Settings Docs Link', 'give'),
123 123
                             'id'    => 'donation_receipt_settings_docs_link',
124
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
-                            'title' => __( 'Donation Receipt Settings', 'give' ),
124
+                            'url'   => esc_url('http://docs.givewp.com/settings-donation-receipt'),
125
+                            'title' => __('Donation Receipt Settings', 'give'),
126 126
                             'type'  => 'give_docs_link',
127 127
                         ),
128 128
 						array(
@@ -141,28 +141,28 @@  discard block
 block discarded – undo
141 141
 						),
142 142
 						array(
143 143
 							'id'      => 'admin_notices',
144
-							'name'    => esc_html__( 'Admin Notifications', 'give' ),
145
-							'desc'    => esc_html__( 'Enable/Disable all admin notifications from Give completely.', 'give' ),
144
+							'name'    => esc_html__('Admin Notifications', 'give'),
145
+							'desc'    => esc_html__('Enable/Disable all admin notifications from Give completely.', 'give'),
146 146
 							'type'    => 'radio_inline',
147 147
 							'default' => 'enabled',
148 148
 							'options' => array(
149
-								'enabled'  => __( 'Enabled', 'give' ),
150
-								'disabled' => __( 'Disabled', 'give' ),
149
+								'enabled'  => __('Enabled', 'give'),
150
+								'disabled' => __('Disabled', 'give'),
151 151
 							)
152 152
 						),
153 153
 						array(
154 154
 							'id'      => 'donation_notification_subject',
155
-							'name'    => esc_html__( 'Donation Notification Subject', 'give' ),
156
-							'desc'    => esc_html__( 'Enter the subject line for the admin donation notification email.', 'give' ),
155
+							'name'    => esc_html__('Donation Notification Subject', 'give'),
156
+							'desc'    => esc_html__('Enter the subject line for the admin donation notification email.', 'give'),
157 157
 							'type'    => 'text',
158
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' )
158
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give')
159 159
 						),
160 160
 						array(
161 161
 							'id'      => 'donation_notification',
162
-							'name'    => esc_html__( 'Donation Notification', 'give' ),
162
+							'name'    => esc_html__('Donation Notification', 'give'),
163 163
 							'desc'    => sprintf(
164 164
 							/* translators: %s: emails tags list */
165
-								__( 'Enter the content of the email that is sent to notify an admin of a new donation. HTML is accepted. <br /><strong>Available template tags:</strong> %s', 'give' ),
165
+								__('Enter the content of the email that is sent to notify an admin of a new donation. HTML is accepted. <br /><strong>Available template tags:</strong> %s', 'give'),
166 166
 								'<br/>'.give_get_emails_tags_list()
167 167
 							),
168 168
 							'type'    => 'wysiwyg',
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
 						),
171 171
 						array(
172 172
 							'id'      => 'admin_notice_emails',
173
-							'name'    => esc_html__( 'Donation Notification Emails', 'give' ),
174
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
173
+							'name'    => esc_html__('Donation Notification Emails', 'give'),
174
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
175 175
 							'type'    => 'textarea',
176
-							'default' => get_bloginfo( 'admin_email' )
176
+							'default' => get_bloginfo('admin_email')
177 177
 						),
178 178
                         array(
179
-                            'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
179
+                            'name'  => esc_html__('Donation Notification Settings Docs Link', 'give'),
180 180
                             'id'    => 'donation_notification_settings_docs_link',
181
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
-                            'title' => __( 'Donation Notification Settings', 'give' ),
181
+                            'url'   => esc_url('http://docs.givewp.com/settings-donation-notification'),
182
+                            'title' => __('Donation Notification Settings', 'give'),
183 183
                             'type'  => 'give_docs_link',
184 184
                         ),
185 185
 						array(
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 			 * Filter the emails settings.
195 195
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
196 196
 			 */
197
-			$settings = apply_filters( 'give_settings_emails', $settings );
197
+			$settings = apply_filters('give_settings_emails', $settings);
198 198
 
199 199
 			/**
200 200
 			 * Filter the settings.
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			 * @since  1.8
203 203
 			 * @param  array $settings
204 204
 			 */
205
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
205
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
206 206
 
207 207
 			// Output.
208 208
 			return $settings;
@@ -216,12 +216,12 @@  discard block
 block discarded – undo
216 216
 		 */
217 217
 		public function get_sections() {
218 218
 			$sections = array(
219
-				'email-settings'            => esc_html__( 'Email Settings', 'give' ),
220
-				'donation-receipt'          => esc_html__( 'Donation Receipt', 'give' ),
221
-				'new-donation-notification' => esc_html__( 'New Donation Notification', 'give' )
219
+				'email-settings'            => esc_html__('Email Settings', 'give'),
220
+				'donation-receipt'          => esc_html__('Donation Receipt', 'give'),
221
+				'new-donation-notification' => esc_html__('New Donation Notification', 'give')
222 222
 			);
223 223
 
224
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
224
+			return apply_filters('give_get_sections_'.$this->id, $sections);
225 225
 		}
226 226
 	}
227 227
 
Please login to merge, or discard this patch.
includes/admin/add-ons.php 1 patch
Spacing   +11 added lines, -11 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
 
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 	ob_start(); ?>
27 27
 	<div class="wrap" id="give-add-ons">
28 28
 		<h1><?php echo get_admin_page_title(); ?>
29
-			&nbsp;&mdash;&nbsp;<a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" target="_blank"><?php esc_html_e( 'View All Add-ons', 'give' ); ?>
29
+			&nbsp;&mdash;&nbsp;<a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" target="_blank"><?php esc_html_e('View All Add-ons', 'give'); ?>
30 30
 				<span class="dashicons dashicons-external"></span></a>
31 31
 		</h1>
32 32
 
33
-		<p><?php esc_html_e( 'The following Add-ons extend the functionality of Give.', 'give' ); ?></p>
33
+		<p><?php esc_html_e('The following Add-ons extend the functionality of Give.', 'give'); ?></p>
34 34
 		<?php echo give_add_ons_get_feed(); ?>
35 35
 	</div>
36 36
 	<?php
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
 function give_add_ons_get_feed() {
49 49
 
50 50
 	$addons_debug = false; //set to true to debug
51
-	$cache        = get_transient( 'give_add_ons_feed' );
51
+	$cache        = get_transient('give_add_ons_feed');
52 52
 
53
-	if ( $cache === false || $addons_debug === true && WP_DEBUG === true ) {
54
-		$feed = wp_remote_get( 'https://givewp.com/downloads/feed/', array( 'sslverify' => false ) );
53
+	if ($cache === false || $addons_debug === true && WP_DEBUG === true) {
54
+		$feed = wp_remote_get('https://givewp.com/downloads/feed/', array('sslverify' => false));
55 55
 
56
-		if ( ! is_wp_error( $feed ) ) {
57
-			if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
58
-				$cache = wp_remote_retrieve_body( $feed );
59
-				set_transient( 'give_add_ons_feed', $cache, 3600 );
56
+		if ( ! is_wp_error($feed)) {
57
+			if (isset($feed['body']) && strlen($feed['body']) > 0) {
58
+				$cache = wp_remote_retrieve_body($feed);
59
+				set_transient('give_add_ons_feed', $cache, 3600);
60 60
 			}
61 61
 		} else {
62
-			$cache = '<div class="error"><p>' . esc_html__( 'There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give' ) . '</div>';
62
+			$cache = '<div class="error"><p>'.esc_html__('There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give').'</div>';
63 63
 		}
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-profile-editor.php 1 patch
Spacing   +3 added lines, -3 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
 
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['label'] = esc_html__( 'Profile Editor', 'give' );
24
+		$this->shortcode['label'] = esc_html__('Profile Editor', 'give');
25 25
 
26
-		parent::__construct( 'give_profile_editor' );
26
+		parent::__construct('give_profile_editor');
27 27
 	}
28 28
 }
29 29
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-receipt.php 1 patch
Spacing   +23 added lines, -23 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
 
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 	 */
25 25
 	public function __construct() {
26 26
 
27
-		$this->shortcode['title'] = esc_html__( 'Donation Receipt', 'give' );
28
-		$this->shortcode['label'] = esc_html__( 'Donation Receipt', 'give' );
27
+		$this->shortcode['title'] = esc_html__('Donation Receipt', 'give');
28
+		$this->shortcode['label'] = esc_html__('Donation Receipt', 'give');
29 29
 
30
-		parent::__construct( 'give_receipt' );
30
+		parent::__construct('give_receipt');
31 31
 	}
32 32
 
33 33
 	/**
@@ -40,60 +40,60 @@  discard block
 block discarded – undo
40 40
 		return array(
41 41
 			array(
42 42
 				'type' => 'container',
43
-				'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'Optional settings', 'give' ) ),
43
+				'html' => sprintf('<p class="strong">%s</p>', esc_html__('Optional settings', 'give')),
44 44
 			),
45 45
 			array(
46 46
 				'type'    => 'listbox',
47 47
 				'name'    => 'price',
48
-				'label'   => esc_html__( 'Show Donation Amount:', 'give' ),
48
+				'label'   => esc_html__('Show Donation Amount:', 'give'),
49 49
 				'options' => array(
50
-					'true'  => esc_html__( 'Show', 'give' ),
51
-					'false' => esc_html__( 'Hide', 'give' ),
50
+					'true'  => esc_html__('Show', 'give'),
51
+					'false' => esc_html__('Hide', 'give'),
52 52
 				),
53 53
 			),
54 54
 			array(
55 55
 				'type'    => 'listbox',
56 56
 				'name'    => 'donor',
57
-				'label'   => esc_html__( 'Show Donor Name:', 'give' ),
57
+				'label'   => esc_html__('Show Donor Name:', 'give'),
58 58
 				'options' => array(
59
-					'true'  => esc_html__( 'Show', 'give' ),
60
-					'false' => esc_html__( 'Hide', 'give' ),
59
+					'true'  => esc_html__('Show', 'give'),
60
+					'false' => esc_html__('Hide', 'give'),
61 61
 				),
62 62
 			),
63 63
 			array(
64 64
 				'type'    => 'listbox',
65 65
 				'name'    => 'date',
66
-				'label'   => esc_html__( 'Show Date:', 'give' ),
66
+				'label'   => esc_html__('Show Date:', 'give'),
67 67
 				'options' => array(
68
-					'true'  => esc_html__( 'Show', 'give' ),
69
-					'false' => esc_html__( 'Hide', 'give' ),
68
+					'true'  => esc_html__('Show', 'give'),
69
+					'false' => esc_html__('Hide', 'give'),
70 70
 				),
71 71
 			),
72 72
 			array(
73 73
 				'type'    => 'listbox',
74 74
 				'name'    => 'payment_key',
75
-				'label'   => esc_html__( 'Show Payment Key:', 'give' ),
75
+				'label'   => esc_html__('Show Payment Key:', 'give'),
76 76
 				'options' => array(
77
-					'true'  => esc_html__( 'Show', 'give' ),
78
-					'false' => esc_html__( 'Hide', 'give' ),
77
+					'true'  => esc_html__('Show', 'give'),
78
+					'false' => esc_html__('Hide', 'give'),
79 79
 				),
80 80
 			),
81 81
 			array(
82 82
 				'type'    => 'listbox',
83 83
 				'name'    => 'payment_method',
84
-				'label'   => esc_html__( 'Show Payment Method:', 'give' ),
84
+				'label'   => esc_html__('Show Payment Method:', 'give'),
85 85
 				'options' => array(
86
-					'true'  => esc_html__( 'Show', 'give' ),
87
-					'false' => esc_html__( 'Hide', 'give' ),
86
+					'true'  => esc_html__('Show', 'give'),
87
+					'false' => esc_html__('Hide', 'give'),
88 88
 				),
89 89
 			),
90 90
 			array(
91 91
 				'type'    => 'listbox',
92 92
 				'name'    => 'payment_id',
93
-				'label'   => esc_html__( 'Show Payment ID:', 'give' ),
93
+				'label'   => esc_html__('Show Payment ID:', 'give'),
94 94
 				'options' => array(
95
-					'true'  => esc_html__( 'Show', 'give' ),
96
-					'false' => esc_html__( 'Hide', 'give' ),
95
+					'true'  => esc_html__('Show', 'give'),
96
+					'false' => esc_html__('Hide', 'give'),
97 97
 				),
98 98
 			),
99 99
 		);
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-register.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
 
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['title'] = esc_html__( 'Register', 'give' );
25
-		$this->shortcode['label'] = esc_html__( 'Register', 'give' );
24
+		$this->shortcode['title'] = esc_html__('Register', 'give');
25
+		$this->shortcode['label'] = esc_html__('Register', 'give');
26 26
 
27
-		parent::__construct( 'give_register' );
27
+		parent::__construct('give_register');
28 28
 	}
29 29
 
30 30
 	/**
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 		return array(
38 38
 			array(
39 39
 				'type' => 'container',
40
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Redirect URL (optional):', 'give' ) ),
40
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Redirect URL (optional):', 'give')),
41 41
 			),
42 42
 			array(
43 43
 				'type'     => 'textbox',
44 44
 				'name'     => 'redirect',
45 45
 				'minWidth' => 320,
46
-				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after registering.', 'give' ),
46
+				'tooltip'  => esc_attr__('Enter an URL here to redirect to after registering.', 'give'),
47 47
 			),
48 48
 		);
49 49
 	}
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-donation-history.php 1 patch
Spacing   +3 added lines, -3 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
 
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['label'] = esc_html__( 'Donation History', 'give' );
24
+		$this->shortcode['label'] = esc_html__('Donation History', 'give');
25 25
 
26
-		parent::__construct( 'donation_history' );
26
+		parent::__construct('donation_history');
27 27
 	}
28 28
 }
29 29
 
Please login to merge, or discard this patch.