@@ -188,8 +188,8 @@ |
||
188 | 188 | |
189 | 189 | $payment_ids = implode( ',', $payment_ids ); |
190 | 190 | $customer->update( array( 'payment_ids' => $payment_ids, |
191 | - 'purchase_count' => $purchase_count, |
|
192 | - 'purchase_value' => $pending_total |
|
191 | + 'purchase_count' => $purchase_count, |
|
192 | + 'purchase_value' => $pending_total |
|
193 | 193 | ) ); |
194 | 194 | |
195 | 195 | $this->done = true; |
@@ -42,16 +42,16 @@ |
||
42 | 42 | 'minWidth' => 320, |
43 | 43 | 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ), |
44 | 44 | ), |
45 | - array( |
|
46 | - 'type' => 'container', |
|
47 | - 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ), |
|
48 | - ), |
|
49 | - array( |
|
50 | - 'type' => 'textbox', |
|
51 | - 'name' => 'logout-redirect', |
|
52 | - 'minWidth' => 320, |
|
53 | - 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ), |
|
54 | - ), |
|
45 | + array( |
|
46 | + 'type' => 'container', |
|
47 | + 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ), |
|
48 | + ), |
|
49 | + array( |
|
50 | + 'type' => 'textbox', |
|
51 | + 'name' => 'logout-redirect', |
|
52 | + 'minWidth' => 320, |
|
53 | + 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ), |
|
54 | + ), |
|
55 | 55 | ); |
56 | 56 | } |
57 | 57 | } |
@@ -248,8 +248,8 @@ |
||
248 | 248 | |
249 | 249 | // do not reindex array! |
250 | 250 | $field['options'] = array( |
251 | - '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ), |
|
252 | - ) + $field['options']; |
|
251 | + '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ), |
|
252 | + ) + $field['options']; |
|
253 | 253 | |
254 | 254 | foreach ( $field['options'] as $value => $text ) { |
255 | 255 | $new_listbox['values'][] = array( |
@@ -427,13 +427,13 @@ discard block |
||
427 | 427 | * |
428 | 428 | * @since 1.0 |
429 | 429 | * @access public |
430 | - * |
|
431 | - * @param array $args |
|
432 | - * |
|
433 | - * @return array|object|null Customers array or object. Null if not found. |
|
430 | + * |
|
431 | + * @param array $args |
|
432 | + * |
|
433 | + * @return array|object|null Customers array or object. Null if not found. |
|
434 | 434 | */ |
435 | 435 | public function get_customers( $args = array() ) { |
436 | - /* @var WPDB $wpdb */ |
|
436 | + /* @var WPDB $wpdb */ |
|
437 | 437 | global $wpdb; |
438 | 438 | |
439 | 439 | $defaults = array( |
@@ -558,13 +558,13 @@ discard block |
||
558 | 558 | * |
559 | 559 | * @since 1.0 |
560 | 560 | * @access public |
561 | - * |
|
562 | - * @param array $args |
|
563 | - * |
|
564 | - * @return int Total number of customers. |
|
561 | + * |
|
562 | + * @param array $args |
|
563 | + * |
|
564 | + * @return int Total number of customers. |
|
565 | 565 | */ |
566 | 566 | public function count( $args = array() ) { |
567 | - /* @var WPDB $wpdb */ |
|
567 | + /* @var WPDB $wpdb */ |
|
568 | 568 | global $wpdb; |
569 | 569 | |
570 | 570 | $where = ' WHERE 1=1 '; |
@@ -358,9 +358,9 @@ |
||
358 | 358 | require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php'; |
359 | 359 | require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php'; |
360 | 360 | |
361 | - if( defined( 'WP_CLI' ) && WP_CLI ) { |
|
362 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php'; |
|
363 | - } |
|
361 | + if( defined( 'WP_CLI' ) && WP_CLI ) { |
|
362 | + require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php'; |
|
363 | + } |
|
364 | 364 | |
365 | 365 | if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
366 | 366 |
@@ -45,22 +45,22 @@ discard block |
||
45 | 45 | * @param string $default_path Default path. Default is empty. |
46 | 46 | */ |
47 | 47 | function give_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) { |
48 | - if ( ! empty( $args ) && is_array( $args ) ) { |
|
49 | - extract( $args ); |
|
50 | - } |
|
48 | + if ( ! empty( $args ) && is_array( $args ) ) { |
|
49 | + extract( $args ); |
|
50 | + } |
|
51 | 51 | |
52 | - $template_names = array( $template_name . '.php' ); |
|
52 | + $template_names = array( $template_name . '.php' ); |
|
53 | 53 | |
54 | - $located = give_locate_template( $template_names, $template_path, $default_path ); |
|
54 | + $located = give_locate_template( $template_names, $template_path, $default_path ); |
|
55 | 55 | |
56 | - if ( ! file_exists( $located ) ) { |
|
56 | + if ( ! file_exists( $located ) ) { |
|
57 | 57 | /* translators: %s: the template */ |
58 | - give_output_error( sprintf( __( 'The %s template was not found.', 'give' ), $located ), true ); |
|
59 | - return; |
|
60 | - } |
|
58 | + give_output_error( sprintf( __( 'The %s template was not found.', 'give' ), $located ), true ); |
|
59 | + return; |
|
60 | + } |
|
61 | 61 | |
62 | - // Allow 3rd party plugin filter template file from their plugin. |
|
63 | - $located = apply_filters( 'give_get_template', $located, $template_name, $args, $template_path, $default_path ); |
|
62 | + // Allow 3rd party plugin filter template file from their plugin. |
|
63 | + $located = apply_filters( 'give_get_template', $located, $template_name, $args, $template_path, $default_path ); |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Fires in give template, before the file is included. |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | * @param string $located Template file filter by 3rd party plugin. |
75 | 75 | * @param array $args Passed arguments. |
76 | 76 | */ |
77 | - do_action( 'give_before_template_part', $template_name, $template_path, $located, $args ); |
|
77 | + do_action( 'give_before_template_part', $template_name, $template_path, $located, $args ); |
|
78 | 78 | |
79 | - include( $located ); |
|
79 | + include( $located ); |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Fires in give template, after the file is included. |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param string $located Template file filter by 3rd party plugin. |
91 | 91 | * @param array $args Passed arguments. |
92 | 92 | */ |
93 | - do_action( 'give_after_template_part', $template_name, $template_path, $located, $args ); |
|
93 | + do_action( 'give_after_template_part', $template_name, $template_path, $located, $args ); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -714,12 +714,12 @@ discard block |
||
714 | 714 | |
715 | 715 | /** |
716 | 716 | * Decrease/Increase a customer's lifetime value. |
717 | - * |
|
718 | - * This function will update donation stat on basis of current amount and new amount donation difference. |
|
719 | - * Difference value can positive or negative. Negative value will decrease user donation stat while positive value increase donation stat. |
|
720 | - * |
|
717 | + * |
|
718 | + * This function will update donation stat on basis of current amount and new amount donation difference. |
|
719 | + * Difference value can positive or negative. Negative value will decrease user donation stat while positive value increase donation stat. |
|
720 | + * |
|
721 | 721 | * @since 1.0 |
722 | - * @access public |
|
722 | + * @access public |
|
723 | 723 | * |
724 | 724 | * @param float $curr_amount Current Donation amount. |
725 | 725 | * @param float $new_amount New (changed) Donation amount. |
@@ -727,35 +727,35 @@ discard block |
||
727 | 727 | * @return mixed If successful, the new donation stat value, otherwise false. |
728 | 728 | */ |
729 | 729 | public function update_donation_value( $curr_amount, $new_amount ) { |
730 | - /** |
|
731 | - * Payment total difference value can be: |
|
732 | - * zero (in case amount not change) |
|
733 | - * or -ve (in case amount decrease) |
|
734 | - * or +ve (in case amount increase) |
|
735 | - */ |
|
736 | - $payment_total_diff = $new_amount - $curr_amount; |
|
737 | - |
|
738 | - // We do not need to update donation stat if donation did not change. |
|
739 | - if( ! $payment_total_diff ) { |
|
740 | - return false; |
|
741 | - } |
|
742 | - |
|
743 | - |
|
744 | - if( $payment_total_diff > 0 ) { |
|
745 | - $this->increase_value( $payment_total_diff ); |
|
746 | - } else { |
|
747 | - // Pass payment total difference as +ve value to decrease amount from user lifetime stat. |
|
748 | - $this->decrease_value( -$payment_total_diff ); |
|
749 | - } |
|
750 | - |
|
751 | - return $this->purchase_value; |
|
730 | + /** |
|
731 | + * Payment total difference value can be: |
|
732 | + * zero (in case amount not change) |
|
733 | + * or -ve (in case amount decrease) |
|
734 | + * or +ve (in case amount increase) |
|
735 | + */ |
|
736 | + $payment_total_diff = $new_amount - $curr_amount; |
|
737 | + |
|
738 | + // We do not need to update donation stat if donation did not change. |
|
739 | + if( ! $payment_total_diff ) { |
|
740 | + return false; |
|
741 | + } |
|
742 | + |
|
743 | + |
|
744 | + if( $payment_total_diff > 0 ) { |
|
745 | + $this->increase_value( $payment_total_diff ); |
|
746 | + } else { |
|
747 | + // Pass payment total difference as +ve value to decrease amount from user lifetime stat. |
|
748 | + $this->decrease_value( -$payment_total_diff ); |
|
749 | + } |
|
750 | + |
|
751 | + return $this->purchase_value; |
|
752 | 752 | } |
753 | 753 | |
754 | 754 | /** |
755 | 755 | * Get the parsed notes for a customer as an array. |
756 | 756 | * |
757 | 757 | * @since 1.0 |
758 | - * @access public |
|
758 | + * @access public |
|
759 | 759 | * |
760 | 760 | * @param int $length The number of notes to get. |
761 | 761 | * @param int $paged What note to start at. |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | * Get the total number of notes we have after parsing. |
781 | 781 | * |
782 | 782 | * @since 1.0 |
783 | - * @access public |
|
783 | + * @access public |
|
784 | 784 | * |
785 | 785 | * @return int The number of notes for the customer. |
786 | 786 | */ |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | * Add a note for the customer. |
798 | 798 | * |
799 | 799 | * @since 1.0 |
800 | - * @access public |
|
800 | + * @access public |
|
801 | 801 | * |
802 | 802 | * @param string $note The note to add. Default is empty. |
803 | 803 | * |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | * Get the notes column for the customer |
857 | 857 | * |
858 | 858 | * @since 1.0 |
859 | - * @access private |
|
859 | + * @access private |
|
860 | 860 | * |
861 | 861 | * @return string The Notes for the customer, non-parsed. |
862 | 862 | */ |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | * Sanitize the data for update/create |
935 | 935 | * |
936 | 936 | * @since 1.0 |
937 | - * @access private |
|
937 | + * @access private |
|
938 | 938 | * |
939 | 939 | * @param array $data The data to sanitize. |
940 | 940 | * |
@@ -114,8 +114,8 @@ |
||
114 | 114 | |
115 | 115 | case 'num_purchases' : |
116 | 116 | $value = '<a href="' . |
117 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] ) |
|
118 | - ) . '">' . esc_html( $item['num_purchases'] ) . '</a>'; |
|
117 | + admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] ) |
|
118 | + ) . '">' . esc_html( $item['num_purchases'] ) . '</a>'; |
|
119 | 119 | break; |
120 | 120 | |
121 | 121 | case 'amount_spent' : |
@@ -586,9 +586,9 @@ |
||
586 | 586 | } |
587 | 587 | |
588 | 588 | echo ' – ' |
589 | - . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
590 | - . ' – ' |
|
591 | - . esc_html( $plugin_data['Version'] ); |
|
589 | + . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
590 | + . ' – ' |
|
591 | + . esc_html( $plugin_data['Version'] ); |
|
592 | 592 | ?> |
593 | 593 | </td> |
594 | 594 | </tr> |