@@ -10,7 +10,7 @@ discard block |
||
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 |
||
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 |
@@ -10,7 +10,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -10,7 +10,7 @@ discard block |
||
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 |
||
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 |
||
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 | ); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | // Exit if accessed directly |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; |
14 | 14 | } |
15 | 15 | |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function __construct() { |
25 | 25 | |
26 | - $this->shortcode['title'] = esc_html__( 'Donation Form Goal', 'give' ); |
|
27 | - $this->shortcode['label'] = esc_html__( 'Donation Form Goal', 'give' ); |
|
26 | + $this->shortcode['title'] = esc_html__('Donation Form Goal', 'give'); |
|
27 | + $this->shortcode['label'] = esc_html__('Donation Form Goal', 'give'); |
|
28 | 28 | |
29 | - parent::__construct( 'give_goal' ); |
|
29 | + parent::__construct('give_goal'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | |
39 | 39 | $create_form_link = sprintf( |
40 | 40 | /* translators: %s: create new form URL */ |
41 | - __( '<a href="%s">Create</a> a new Donation Form.', 'give' ), |
|
42 | - admin_url( 'post-new.php?post_type=give_forms' ) |
|
41 | + __('<a href="%s">Create</a> a new Donation Form.', 'give'), |
|
42 | + admin_url('post-new.php?post_type=give_forms') |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | return array( |
@@ -49,35 +49,35 @@ discard block |
||
49 | 49 | 'post_type' => 'give_forms', |
50 | 50 | ), |
51 | 51 | 'name' => 'id', |
52 | - 'tooltip' => esc_attr__( 'Select a Donation Form', 'give' ), |
|
53 | - 'placeholder' => esc_attr__( '- Select a Form -', 'give' ), |
|
52 | + 'tooltip' => esc_attr__('Select a Donation Form', 'give'), |
|
53 | + 'placeholder' => esc_attr__('- Select a Form -', 'give'), |
|
54 | 54 | 'required' => array( |
55 | - 'alert' => esc_html__( 'You must first select a Form!', 'give' ), |
|
56 | - 'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__( 'No forms found.', 'give' ), $create_form_link ), |
|
55 | + 'alert' => esc_html__('You must first select a Form!', 'give'), |
|
56 | + 'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__('No forms found.', 'give'), $create_form_link), |
|
57 | 57 | ), |
58 | 58 | ), |
59 | 59 | array( |
60 | 60 | 'type' => 'container', |
61 | - 'html' => sprintf( '<p class="strong margin-top">%s</p>', esc_html__( 'Optional settings', 'give' ) ), |
|
61 | + 'html' => sprintf('<p class="strong margin-top">%s</p>', esc_html__('Optional settings', 'give')), |
|
62 | 62 | ), |
63 | 63 | array( |
64 | 64 | 'type' => 'listbox', |
65 | 65 | 'name' => 'show_text', |
66 | - 'label' => esc_attr__( 'Show Text:', 'give' ), |
|
67 | - 'tooltip' => esc_attr__( 'This text displays the amount of income raised compared to the goal.', 'give' ), |
|
66 | + 'label' => esc_attr__('Show Text:', 'give'), |
|
67 | + 'tooltip' => esc_attr__('This text displays the amount of income raised compared to the goal.', 'give'), |
|
68 | 68 | 'options' => array( |
69 | - 'true' => esc_html__( 'Show', 'give' ), |
|
70 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
69 | + 'true' => esc_html__('Show', 'give'), |
|
70 | + 'false' => esc_html__('Hide', 'give'), |
|
71 | 71 | ), |
72 | 72 | ), |
73 | 73 | array( |
74 | 74 | 'type' => 'listbox', |
75 | 75 | 'name' => 'show_bar', |
76 | - 'label' => esc_attr__( 'Show Progress Bar:', 'give' ), |
|
77 | - 'tooltip' => esc_attr__( 'Do you want to display the goal\'s progress bar?', 'give' ), |
|
76 | + 'label' => esc_attr__('Show Progress Bar:', 'give'), |
|
77 | + 'tooltip' => esc_attr__('Do you want to display the goal\'s progress bar?', 'give'), |
|
78 | 78 | 'options' => array( |
79 | - 'true' => esc_html__( 'Show', 'give' ), |
|
80 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
79 | + 'true' => esc_html__('Show', 'give'), |
|
80 | + 'false' => esc_html__('Hide', 'give'), |
|
81 | 81 | ), |
82 | 82 | ), |
83 | 83 | ); |
@@ -10,7 +10,7 @@ discard block |
||
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 |
||
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 |
@@ -10,7 +10,7 @@ discard block |
||
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 |
||
26 | 26 | ob_start(); ?> |
27 | 27 | <div class="wrap" id="give-add-ons"> |
28 | 28 | <h1><?php echo get_admin_page_title(); ?> |
29 | - — <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 | + — <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 |
||
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 |
@@ -10,7 +10,7 @@ discard block |
||
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,9 +24,9 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function give_customers_page() { |
26 | 26 | $default_views = give_customer_views(); |
27 | - $requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'customers'; |
|
28 | - if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) { |
|
29 | - give_render_customer_view( $requested_view, $default_views ); |
|
27 | + $requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'customers'; |
|
28 | + if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) { |
|
29 | + give_render_customer_view($requested_view, $default_views); |
|
30 | 30 | } else { |
31 | 31 | give_customers_list(); |
32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $views = array(); |
44 | 44 | |
45 | - return apply_filters( 'give_customer_views', $views ); |
|
45 | + return apply_filters('give_customer_views', $views); |
|
46 | 46 | |
47 | 47 | } |
48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $tabs = array(); |
58 | 58 | |
59 | - return apply_filters( 'give_customer_tabs', $tabs ); |
|
59 | + return apply_filters('give_customer_tabs', $tabs); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return void |
68 | 68 | */ |
69 | 69 | function give_customers_list() { |
70 | - include( dirname( __FILE__ ) . '/class-customer-table.php' ); |
|
70 | + include(dirname(__FILE__).'/class-customer-table.php'); |
|
71 | 71 | |
72 | 72 | $customers_table = new Give_Customer_Reports_Table(); |
73 | 73 | $customers_table->prepare_items(); |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @since 1.0 |
82 | 82 | */ |
83 | - do_action( 'give_donors_table_top' ); |
|
83 | + do_action('give_donors_table_top'); |
|
84 | 84 | ?> |
85 | - <form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>"> |
|
85 | + <form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>"> |
|
86 | 86 | <?php |
87 | - $customers_table->search_box( esc_html__( 'Search Donors', 'give' ), 'give-donors' ); |
|
87 | + $customers_table->search_box(esc_html__('Search Donors', 'give'), 'give-donors'); |
|
88 | 88 | $customers_table->display(); |
89 | 89 | ?> |
90 | 90 | <input type="hidden" name="post_type" value="give_forms" /> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 1.0 |
99 | 99 | */ |
100 | - do_action( 'give_donors_table_bottom' ); |
|
100 | + do_action('give_donors_table_bottom'); |
|
101 | 101 | ?> |
102 | 102 | </div> |
103 | 103 | <?php |
@@ -113,27 +113,27 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return void |
115 | 115 | */ |
116 | -function give_render_customer_view( $view, $callbacks ) { |
|
116 | +function give_render_customer_view($view, $callbacks) { |
|
117 | 117 | |
118 | 118 | $render = true; |
119 | 119 | |
120 | - $customer_view_role = apply_filters( 'give_view_customers_role', 'view_give_reports' ); |
|
120 | + $customer_view_role = apply_filters('give_view_customers_role', 'view_give_reports'); |
|
121 | 121 | |
122 | - if ( ! current_user_can( $customer_view_role ) ) { |
|
123 | - give_set_error( 'give-no-access', esc_html__( 'You are not permitted to view this data.', 'give' ) ); |
|
122 | + if ( ! current_user_can($customer_view_role)) { |
|
123 | + give_set_error('give-no-access', esc_html__('You are not permitted to view this data.', 'give')); |
|
124 | 124 | $render = false; |
125 | 125 | } |
126 | 126 | |
127 | - if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
128 | - give_set_error( 'give-invalid_customer', esc_html__( 'Invalid Donor ID.', 'give' ) ); |
|
127 | + if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
128 | + give_set_error('give-invalid_customer', esc_html__('Invalid Donor ID.', 'give')); |
|
129 | 129 | $render = false; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $customer_id = (int) $_GET['id']; |
133 | - $customer = new Give_Customer( $customer_id ); |
|
133 | + $customer = new Give_Customer($customer_id); |
|
134 | 134 | |
135 | - if ( empty( $customer->id ) ) { |
|
136 | - give_set_error( 'give-invalid_customer', esc_html__( 'Invalid Donor ID.', 'give' ) ); |
|
135 | + if (empty($customer->id)) { |
|
136 | + give_set_error('give-invalid_customer', esc_html__('Invalid Donor ID.', 'give')); |
|
137 | 137 | $render = false; |
138 | 138 | } |
139 | 139 | |
@@ -142,34 +142,34 @@ discard block |
||
142 | 142 | |
143 | 143 | <div class='wrap'> |
144 | 144 | |
145 | - <?php if ( give_get_errors() ) : ?> |
|
145 | + <?php if (give_get_errors()) : ?> |
|
146 | 146 | <div class="error settings-error"> |
147 | - <?php give_print_errors( 0 ); ?> |
|
147 | + <?php give_print_errors(0); ?> |
|
148 | 148 | </div> |
149 | 149 | <?php endif; ?> |
150 | 150 | |
151 | - <h1 class="screen-reader-text"><?php esc_html_e( 'Donor', 'give' ); ?></h1> |
|
151 | + <h1 class="screen-reader-text"><?php esc_html_e('Donor', 'give'); ?></h1> |
|
152 | 152 | |
153 | - <?php if ( $customer && $render ) : ?> |
|
153 | + <?php if ($customer && $render) : ?> |
|
154 | 154 | |
155 | 155 | <h2 class="nav-tab-wrapper"> |
156 | 156 | <?php |
157 | - foreach ( $customer_tabs as $key => $tab ) : |
|
157 | + foreach ($customer_tabs as $key => $tab) : |
|
158 | 158 | $active = $key === $view ? true : false; |
159 | 159 | $class = $active ? 'nav-tab nav-tab-active' : 'nav-tab'; |
160 | 160 | printf( |
161 | 161 | '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n", |
162 | - esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $customer->id ) ), |
|
163 | - esc_attr( $class ), |
|
164 | - sanitize_html_class( $tab['dashicon'] ), |
|
165 | - esc_html( $tab['title'] ) |
|
162 | + esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$customer->id)), |
|
163 | + esc_attr($class), |
|
164 | + sanitize_html_class($tab['dashicon']), |
|
165 | + esc_html($tab['title']) |
|
166 | 166 | ); |
167 | 167 | endforeach; |
168 | 168 | ?> |
169 | 169 | </h2> |
170 | 170 | |
171 | 171 | <div id="give-customer-card-wrapper"> |
172 | - <?php $callbacks[ $view ]( $customer ) ?> |
|
172 | + <?php $callbacks[$view]($customer) ?> |
|
173 | 173 | </div> |
174 | 174 | |
175 | 175 | <?php endif; ?> |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @return void |
191 | 191 | */ |
192 | -function give_customers_view( $customer ) { |
|
192 | +function give_customers_view($customer) { |
|
193 | 193 | |
194 | - $customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' ); |
|
194 | + $customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments'); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Fires in donor profile screen, above the donor card. |
@@ -200,32 +200,32 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @param object $customer The customer object being displayed. |
202 | 202 | */ |
203 | - do_action( 'give_donor_card_top', $customer ); |
|
203 | + do_action('give_donor_card_top', $customer); |
|
204 | 204 | ?> |
205 | 205 | |
206 | 206 | <div id="donor-summary" class="info-wrapper customer-section postbox"> |
207 | 207 | |
208 | - <form id="edit-customer-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>"> |
|
208 | + <form id="edit-customer-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?>"> |
|
209 | 209 | |
210 | 210 | <div class="customer-info"> |
211 | 211 | |
212 | 212 | <div class="donor-bio-header clearfix"> |
213 | 213 | |
214 | 214 | <div class="avatar-wrap left" id="customer-avatar"> |
215 | - <?php echo get_avatar( $customer->email ); ?> |
|
215 | + <?php echo get_avatar($customer->email); ?> |
|
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <div id="customer-name-wrap" class="left"> |
219 | 219 | <span class="customer-id">#<?php echo $customer->id; ?></span> |
220 | - <span class="customer-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr( $customer->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span> |
|
220 | + <span class="customer-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr($customer->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span> |
|
221 | 221 | <span class="customer-name info-item editable"><span data-key="name"><?php echo $customer->name; ?></span></span> |
222 | 222 | </div> |
223 | 223 | <p class="customer-since info-item"> |
224 | - <?php esc_html_e( 'Donor since', 'give' ); ?> |
|
225 | - <?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?> |
|
224 | + <?php esc_html_e('Donor since', 'give'); ?> |
|
225 | + <?php echo date_i18n(give_date_format(), strtotime($customer->date_created)) ?> |
|
226 | 226 | </p> |
227 | - <?php if ( current_user_can( $customer_edit_role ) ): ?> |
|
228 | - <a href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a> |
|
227 | + <?php if (current_user_can($customer_edit_role)): ?> |
|
228 | + <a href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a> |
|
229 | 229 | <?php endif; ?> |
230 | 230 | </div> |
231 | 231 | <!-- /donor-bio-header --> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | <table class="widefat"> |
236 | 236 | <tbody> |
237 | 237 | <tr class="alternate"> |
238 | - <th scope="col"><label for="tablecell"><?php esc_html_e( 'User ID:', 'give' ); ?></label></th> |
|
238 | + <th scope="col"><label for="tablecell"><?php esc_html_e('User ID:', 'give'); ?></label></th> |
|
239 | 239 | <td class="row-title"> |
240 | 240 | <span class="customer-user-id info-item edit-item"> |
241 | 241 | <?php |
@@ -251,38 +251,38 @@ discard block |
||
251 | 251 | 'data' => $data_atts, |
252 | 252 | ); |
253 | 253 | |
254 | - if ( ! empty( $user_id ) ) { |
|
255 | - $userdata = get_userdata( $user_id ); |
|
254 | + if ( ! empty($user_id)) { |
|
255 | + $userdata = get_userdata($user_id); |
|
256 | 256 | $user_args['value'] = $userdata->user_login; |
257 | 257 | } |
258 | 258 | |
259 | - echo Give()->html->ajax_user_search( $user_args ); |
|
259 | + echo Give()->html->ajax_user_search($user_args); |
|
260 | 260 | ?> |
261 | 261 | <input type="hidden" name="customerinfo[user_id]" data-key="user_id" value="<?php echo $customer->user_id; ?>" /> |
262 | 262 | </span> |
263 | 263 | |
264 | 264 | <span class="customer-user-id info-item editable"> |
265 | - <?php if ( intval( $customer->user_id ) > 0 ) { ?> |
|
265 | + <?php if (intval($customer->user_id) > 0) { ?> |
|
266 | 266 | <span data-key="user_id"><?php echo $customer->user_id; ?></span> |
267 | 267 | <?php } else { ?> |
268 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> |
|
268 | + <span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span> |
|
269 | 269 | <?php } ?> |
270 | - <?php if ( current_user_can( $customer_edit_role ) && intval( $customer->user_id ) > 0 ) { ?> |
|
271 | - <span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" aria-label="<?php esc_attr_e( 'Disconnects the current user ID from this customer record.', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> |
|
270 | + <?php if (current_user_can($customer_edit_role) && intval($customer->user_id) > 0) { ?> |
|
271 | + <span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" aria-label="<?php esc_attr_e('Disconnects the current user ID from this customer record.', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span> |
|
272 | 272 | <?php } ?> |
273 | 273 | </span> |
274 | 274 | </td> |
275 | 275 | </tr> |
276 | - <?php if ( isset( $customer->user_id ) && $customer->user_id > 0 ) : ?> |
|
276 | + <?php if (isset($customer->user_id) && $customer->user_id > 0) : ?> |
|
277 | 277 | |
278 | 278 | <tr> |
279 | - <th scope="col"><?php esc_html_e( 'Address:', 'give' ); ?></th> |
|
279 | + <th scope="col"><?php esc_html_e('Address:', 'give'); ?></th> |
|
280 | 280 | <td class="row-title"> |
281 | 281 | |
282 | 282 | <div class="customer-address-wrapper"> |
283 | 283 | |
284 | 284 | <?php |
285 | - $address = get_user_meta( $customer->user_id, '_give_user_address', true ); |
|
285 | + $address = get_user_meta($customer->user_id, '_give_user_address', true); |
|
286 | 286 | $defaults = array( |
287 | 287 | 'line1' => '', |
288 | 288 | 'line2' => '', |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | 'zip' => '' |
293 | 293 | ); |
294 | 294 | |
295 | - $address = wp_parse_args( $address, $defaults ); |
|
295 | + $address = wp_parse_args($address, $defaults); |
|
296 | 296 | ?> |
297 | 297 | |
298 | - <?php if ( ! empty( $address ) ) { ?> |
|
298 | + <?php if ( ! empty($address)) { ?> |
|
299 | 299 | <span class="customer-address info-item editable"> |
300 | 300 | <span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span> |
301 | 301 | <span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span> |
@@ -306,43 +306,43 @@ discard block |
||
306 | 306 | </span> |
307 | 307 | <?php } ?> |
308 | 308 | <span class="customer-address info-item edit-item"> |
309 | - <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | - <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | - <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" /> |
|
309 | + <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | + <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | + <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" /> |
|
312 | 312 | <select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item"> |
313 | 313 | <?php |
314 | 314 | |
315 | 315 | $selected_country = $address['country']; |
316 | 316 | |
317 | 317 | $countries = give_get_country_list(); |
318 | - foreach ( $countries as $country_code => $country ) { |
|
319 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
318 | + foreach ($countries as $country_code => $country) { |
|
319 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
320 | 320 | } |
321 | 321 | ?> |
322 | 322 | </select> |
323 | 323 | <?php |
324 | 324 | $selected_state = give_get_state(); |
325 | - $states = give_get_states( $selected_country ); |
|
325 | + $states = give_get_states($selected_country); |
|
326 | 326 | |
327 | - $selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state; |
|
327 | + $selected_state = isset($address['state']) ? $address['state'] : $selected_state; |
|
328 | 328 | |
329 | - if ( ! empty( $states ) ) { |
|
329 | + if ( ! empty($states)) { |
|
330 | 330 | ?> |
331 | 331 | <select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item"> |
332 | 332 | <?php |
333 | - foreach ( $states as $state_code => $state ) { |
|
334 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
333 | + foreach ($states as $state_code => $state) { |
|
334 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
335 | 335 | } |
336 | 336 | ?> |
337 | 337 | </select> |
338 | 338 | <?php |
339 | 339 | } else { |
340 | 340 | ?> |
341 | - <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province', 'give' ); ?>" /> |
|
341 | + <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e('State / Province', 'give'); ?>" /> |
|
342 | 342 | <?php |
343 | 343 | } |
344 | 344 | ?> |
345 | - <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
|
345 | + <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" /> |
|
346 | 346 | </span> |
347 | 347 | |
348 | 348 | </div> |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | |
359 | 359 | <span id="customer-edit-actions" class="edit-item"> |
360 | 360 | <input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $customer->id; ?>" /> |
361 | - <?php wp_nonce_field( 'edit-customer', '_wpnonce', false, true ); ?> |
|
361 | + <?php wp_nonce_field('edit-customer', '_wpnonce', false, true); ?> |
|
362 | 362 | <input type="hidden" name="give_action" value="edit-customer" /> |
363 | - <input type="submit" id="give-edit-customer-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" /> |
|
364 | - <a id="give-edit-customer-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
363 | + <input type="submit" id="give-edit-customer-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" /> |
|
364 | + <a id="give-edit-customer-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
365 | 365 | </span> |
366 | 366 | |
367 | 367 | </form> |
@@ -376,24 +376,24 @@ discard block |
||
376 | 376 | * |
377 | 377 | * @param object $customer The customer object being displayed. |
378 | 378 | */ |
379 | - do_action( 'give_donor_before_stats', $customer ); |
|
379 | + do_action('give_donor_before_stats', $customer); |
|
380 | 380 | ?> |
381 | 381 | |
382 | 382 | <div id="customer-stats-wrapper" class="customer-section postbox clear"> |
383 | 383 | <ul> |
384 | 384 | <li> |
385 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $customer->email ) ); ?>"> |
|
385 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($customer->email)); ?>"> |
|
386 | 386 | <span class="dashicons dashicons-heart"></span> |
387 | 387 | <?php |
388 | 388 | //Completed Donations |
389 | - $completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $customer->purchase_count, 'give' ), $customer->purchase_count ); |
|
390 | - echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $customer ); |
|
389 | + $completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $customer->purchase_count, 'give'), $customer->purchase_count); |
|
390 | + echo apply_filters('give_donor_completed_donations', $completed_donations_text, $customer); |
|
391 | 391 | ?> |
392 | 392 | </a> |
393 | 393 | </li> |
394 | 394 | <li> |
395 | 395 | <span class="dashicons dashicons-chart-area"></span> |
396 | - <?php echo give_currency_filter( give_format_amount( $customer->purchase_value ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?> |
|
396 | + <?php echo give_currency_filter(give_format_amount($customer->purchase_value)); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?> |
|
397 | 397 | </li> |
398 | 398 | <?php |
399 | 399 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * |
406 | 406 | * @param object $customer The customer object being displayed. |
407 | 407 | */ |
408 | - do_action( 'give_donor_stats_list', $customer ); |
|
408 | + do_action('give_donor_stats_list', $customer); |
|
409 | 409 | ?> |
410 | 410 | </ul> |
411 | 411 | </div> |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @param object $customer The customer object being displayed. |
420 | 420 | */ |
421 | - do_action( 'give_donor_before_tables_wrapper', $customer ); |
|
421 | + do_action('give_donor_before_tables_wrapper', $customer); |
|
422 | 422 | ?> |
423 | 423 | |
424 | 424 | <div id="customer-tables-wrapper" class="customer-section"> |
@@ -431,40 +431,40 @@ discard block |
||
431 | 431 | * |
432 | 432 | * @param object $customer The customer object being displayed. |
433 | 433 | */ |
434 | - do_action( 'give_donor_before_tables', $customer ); |
|
434 | + do_action('give_donor_before_tables', $customer); |
|
435 | 435 | ?> |
436 | 436 | |
437 | - <h3><?php _e( 'Donor Emails', 'give' ); ?></h3> |
|
437 | + <h3><?php _e('Donor Emails', 'give'); ?></h3> |
|
438 | 438 | |
439 | 439 | <table class="wp-list-table widefat striped emails"> |
440 | 440 | <thead> |
441 | 441 | <tr> |
442 | - <th><?php _e( 'Email', 'give' ); ?></th> |
|
443 | - <th><?php _e( 'Actions', 'give' ); ?></th> |
|
442 | + <th><?php _e('Email', 'give'); ?></th> |
|
443 | + <th><?php _e('Actions', 'give'); ?></th> |
|
444 | 444 | </tr> |
445 | 445 | </thead> |
446 | 446 | |
447 | 447 | <tbody> |
448 | - <?php if ( ! empty( $customer->emails ) ) { ?> |
|
448 | + <?php if ( ! empty($customer->emails)) { ?> |
|
449 | 449 | |
450 | - <?php foreach ( $customer->emails as $key => $email ) : ?> |
|
450 | + <?php foreach ($customer->emails as $key => $email) : ?> |
|
451 | 451 | <tr data-key="<?php echo $key; ?>"> |
452 | 452 | <td> |
453 | 453 | <?php echo $email; ?> |
454 | - <?php if ( 'primary' === $key ) : ?> |
|
454 | + <?php if ('primary' === $key) : ?> |
|
455 | 455 | <span class="dashicons dashicons-star-filled primary-email-icon"></span> |
456 | 456 | <?php endif; ?> |
457 | 457 | </td> |
458 | 458 | <td> |
459 | - <?php if ( 'primary' !== $key ) : ?> |
|
459 | + <?php if ('primary' !== $key) : ?> |
|
460 | 460 | <?php |
461 | - $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); |
|
462 | - $promote_url = wp_nonce_url( add_query_arg( array( 'email' => rawurlencode( $email ), 'give_action' => 'set_donor_primary_email'), $base_url ), 'give-set-donor-primary-email' ); |
|
463 | - $remove_url = wp_nonce_url( add_query_arg( array( 'email' => rawurlencode( $email ), 'give_action' => 'remove_donor_email' ), $base_url ), 'give-remove-donor-email' ); |
|
461 | + $base_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); |
|
462 | + $promote_url = wp_nonce_url(add_query_arg(array('email' => rawurlencode($email), 'give_action' => 'set_donor_primary_email'), $base_url), 'give-set-donor-primary-email'); |
|
463 | + $remove_url = wp_nonce_url(add_query_arg(array('email' => rawurlencode($email), 'give_action' => 'remove_donor_email'), $base_url), 'give-remove-donor-email'); |
|
464 | 464 | ?> |
465 | - <a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a> |
|
465 | + <a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a> |
|
466 | 466 | | |
467 | - <a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a> |
|
467 | + <a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a> |
|
468 | 468 | <?php endif; ?> |
469 | 469 | </td> |
470 | 470 | </tr> |
@@ -474,56 +474,56 @@ discard block |
||
474 | 474 | <td colspan="2" class="add-customer-email-td"> |
475 | 475 | <div class="add-customer-email-wrapper"> |
476 | 476 | <input type="hidden" name="customer-id" value="<?php echo $customer->id; ?>" /> |
477 | - <?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?> |
|
478 | - <input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" /> |
|
479 | - <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label> |
|
480 | - <button class="button-secondary give-add-customer-email" id="add-customer-email"><?php _e( 'Add Email', 'give' ); ?></button> |
|
477 | + <?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?> |
|
478 | + <input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" /> |
|
479 | + <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label> |
|
480 | + <button class="button-secondary give-add-customer-email" id="add-customer-email"><?php _e('Add Email', 'give'); ?></button> |
|
481 | 481 | <span class="spinner"></span> |
482 | 482 | </div> |
483 | 483 | <div class="notice-wrap"></div> |
484 | 484 | </td> |
485 | 485 | </tr> |
486 | 486 | <?php } else { ?> |
487 | - <tr><td colspan="2"><?php _e( 'No Emails Found', 'easy-digital-downloads' ); ?></td></tr> |
|
487 | + <tr><td colspan="2"><?php _e('No Emails Found', 'easy-digital-downloads'); ?></td></tr> |
|
488 | 488 | <?php } ?> |
489 | 489 | </tbody> |
490 | 490 | </table> |
491 | 491 | |
492 | - <h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3> |
|
492 | + <h3><?php esc_html_e('Recent Donations', 'give'); ?></h3> |
|
493 | 493 | <?php |
494 | - $payment_ids = explode( ',', $customer->payment_ids ); |
|
495 | - $payments = give_get_payments( array( 'post__in' => $payment_ids ) ); |
|
496 | - $payments = array_slice( $payments, 0, 10 ); |
|
494 | + $payment_ids = explode(',', $customer->payment_ids); |
|
495 | + $payments = give_get_payments(array('post__in' => $payment_ids)); |
|
496 | + $payments = array_slice($payments, 0, 10); |
|
497 | 497 | ?> |
498 | 498 | <table class="wp-list-table widefat striped payments"> |
499 | 499 | <thead> |
500 | 500 | <tr> |
501 | - <th scope="col"><?php esc_html_e( 'ID', 'give' ); ?></th> |
|
502 | - <th scope="col"><?php esc_html_e( 'Amount', 'give' ); ?></th> |
|
503 | - <th scope="col"><?php esc_html_e( 'Date', 'give' ); ?></th> |
|
504 | - <th scope="col"><?php esc_html_e( 'Status', 'give' ); ?></th> |
|
505 | - <th scope="col"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
501 | + <th scope="col"><?php esc_html_e('ID', 'give'); ?></th> |
|
502 | + <th scope="col"><?php esc_html_e('Amount', 'give'); ?></th> |
|
503 | + <th scope="col"><?php esc_html_e('Date', 'give'); ?></th> |
|
504 | + <th scope="col"><?php esc_html_e('Status', 'give'); ?></th> |
|
505 | + <th scope="col"><?php esc_html_e('Actions', 'give'); ?></th> |
|
506 | 506 | </tr> |
507 | 507 | </thead> |
508 | 508 | <tbody> |
509 | - <?php if ( ! empty( $payments ) ) { ?> |
|
510 | - <?php foreach ( $payments as $payment ) : ?> |
|
509 | + <?php if ( ! empty($payments)) { ?> |
|
510 | + <?php foreach ($payments as $payment) : ?> |
|
511 | 511 | <tr> |
512 | 512 | <td><?php echo $payment->ID; ?></td> |
513 | - <td><?php echo give_payment_amount( $payment->ID ); ?></td> |
|
514 | - <td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td> |
|
515 | - <td><?php echo give_get_payment_status( $payment, true ); ?></td> |
|
513 | + <td><?php echo give_payment_amount($payment->ID); ?></td> |
|
514 | + <td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td> |
|
515 | + <td><?php echo give_get_payment_status($payment, true); ?></td> |
|
516 | 516 | <td> |
517 | 517 | <?php |
518 | 518 | printf( |
519 | 519 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
520 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment->ID ), |
|
520 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$payment->ID), |
|
521 | 521 | sprintf( |
522 | 522 | /* translators: %s: Donation ID */ |
523 | - esc_attr__( 'View Donation %s.', 'give' ), |
|
523 | + esc_attr__('View Donation %s.', 'give'), |
|
524 | 524 | $payment->ID |
525 | 525 | ), |
526 | - esc_html__( 'View Donation', 'give' ) |
|
526 | + esc_html__('View Donation', 'give') |
|
527 | 527 | ); |
528 | 528 | ?> |
529 | 529 | |
@@ -538,46 +538,46 @@ discard block |
||
538 | 538 | * @param object $customer The customer object being displayed. |
539 | 539 | * @param object $payment The payment object being displayed. |
540 | 540 | */ |
541 | - do_action( 'give_donor_recent_purchases_actions', $customer, $payment ); |
|
541 | + do_action('give_donor_recent_purchases_actions', $customer, $payment); |
|
542 | 542 | ?> |
543 | 543 | </td> |
544 | 544 | </tr> |
545 | 545 | <?php endforeach; ?> |
546 | 546 | <?php } else { ?> |
547 | 547 | <tr> |
548 | - <td colspan="5"><?php esc_html_e( 'No donations found.', 'give' ); ?></td> |
|
548 | + <td colspan="5"><?php esc_html_e('No donations found.', 'give'); ?></td> |
|
549 | 549 | </tr> |
550 | 550 | <?php } ?> |
551 | 551 | </tbody> |
552 | 552 | </table> |
553 | 553 | |
554 | - <h3><?php esc_html_e( 'Completed Donations', 'give' ); ?></h3> |
|
554 | + <h3><?php esc_html_e('Completed Donations', 'give'); ?></h3> |
|
555 | 555 | <?php |
556 | - $donations = give_get_users_completed_donations( $customer->email ); |
|
556 | + $donations = give_get_users_completed_donations($customer->email); |
|
557 | 557 | ?> |
558 | 558 | <table class="wp-list-table widefat striped donations"> |
559 | 559 | <thead> |
560 | 560 | <tr> |
561 | - <th scope="col"><?php esc_html_e( 'Form', 'give' ); ?></th> |
|
562 | - <th scope="col" width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
561 | + <th scope="col"><?php esc_html_e('Form', 'give'); ?></th> |
|
562 | + <th scope="col" width="120px"><?php esc_html_e('Actions', 'give'); ?></th> |
|
563 | 563 | </tr> |
564 | 564 | </thead> |
565 | 565 | <tbody> |
566 | - <?php if ( ! empty( $donations ) ) { ?> |
|
567 | - <?php foreach ( $donations as $donation ) : ?> |
|
566 | + <?php if ( ! empty($donations)) { ?> |
|
567 | + <?php foreach ($donations as $donation) : ?> |
|
568 | 568 | <tr> |
569 | 569 | <td><?php echo $donation->post_title; ?></td> |
570 | 570 | <td> |
571 | 571 | <?php |
572 | 572 | printf( |
573 | 573 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
574 | - esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ), |
|
574 | + esc_url(admin_url('post.php?action=edit&post='.$donation->ID)), |
|
575 | 575 | sprintf( |
576 | 576 | /* translators: %s: form name */ |
577 | - esc_attr__( 'View Form %s.', 'give' ), |
|
577 | + esc_attr__('View Form %s.', 'give'), |
|
578 | 578 | $donation->post_title |
579 | 579 | ), |
580 | - esc_html__( 'View Form', 'give' ) |
|
580 | + esc_html__('View Form', 'give') |
|
581 | 581 | ); |
582 | 582 | ?> |
583 | 583 | </td> |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | <?php endforeach; ?> |
586 | 586 | <?php } else { ?> |
587 | 587 | <tr> |
588 | - <td colspan="2"><?php esc_html_e( 'No completed donations found.', 'give' ); ?></td> |
|
588 | + <td colspan="2"><?php esc_html_e('No completed donations found.', 'give'); ?></td> |
|
589 | 589 | </tr> |
590 | 590 | <?php } ?> |
591 | 591 | </tbody> |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | * |
600 | 600 | * @param object $customer The customer object being displayed. |
601 | 601 | */ |
602 | - do_action( 'give_donor_after_tables', $customer ); |
|
602 | + do_action('give_donor_after_tables', $customer); |
|
603 | 603 | ?> |
604 | 604 | |
605 | 605 | </div> |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | * |
613 | 613 | * @param object $customer The customer object being displayed. |
614 | 614 | */ |
615 | - do_action( 'give_donor_card_bottom', $customer ); |
|
615 | + do_action('give_donor_card_bottom', $customer); |
|
616 | 616 | |
617 | 617 | } |
618 | 618 | |
@@ -625,30 +625,30 @@ discard block |
||
625 | 625 | * |
626 | 626 | * @return void |
627 | 627 | */ |
628 | -function give_customer_notes_view( $customer ) { |
|
628 | +function give_customer_notes_view($customer) { |
|
629 | 629 | |
630 | - $paged = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1; |
|
631 | - $paged = absint( $paged ); |
|
630 | + $paged = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1; |
|
631 | + $paged = absint($paged); |
|
632 | 632 | $note_count = $customer->get_notes_count(); |
633 | - $per_page = apply_filters( 'give_customer_notes_per_page', 20 ); |
|
634 | - $total_pages = ceil( $note_count / $per_page ); |
|
635 | - $customer_notes = $customer->get_notes( $per_page, $paged ); |
|
633 | + $per_page = apply_filters('give_customer_notes_per_page', 20); |
|
634 | + $total_pages = ceil($note_count / $per_page); |
|
635 | + $customer_notes = $customer->get_notes($per_page, $paged); |
|
636 | 636 | ?> |
637 | 637 | |
638 | 638 | <div id="customer-notes-wrapper"> |
639 | 639 | <div class="customer-notes-header"> |
640 | - <?php echo get_avatar( $customer->email, 30 ); ?> <span><?php echo $customer->name; ?></span> |
|
640 | + <?php echo get_avatar($customer->email, 30); ?> <span><?php echo $customer->name; ?></span> |
|
641 | 641 | </div> |
642 | - <h3><?php esc_html_e( 'Notes', 'give' ); ?></h3> |
|
642 | + <h3><?php esc_html_e('Notes', 'give'); ?></h3> |
|
643 | 643 | |
644 | - <?php if ( 1 == $paged ) : ?> |
|
644 | + <?php if (1 == $paged) : ?> |
|
645 | 645 | <div style="display: block; margin-bottom: 55px;"> |
646 | - <form id="give-add-customer-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $customer->id ); ?>"> |
|
646 | + <form id="give-add-customer-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$customer->id); ?>"> |
|
647 | 647 | <textarea id="customer-note" name="customer_note" class="customer-note-input" rows="10"></textarea> |
648 | 648 | <br /> |
649 | 649 | <input type="hidden" id="customer-id" name="customer_id" value="<?php echo $customer->id; ?>" /> |
650 | 650 | <input type="hidden" name="give_action" value="add-customer-note" /> |
651 | - <?php wp_nonce_field( 'add-customer-note', 'add_customer_note_nonce', true, true ); ?> |
|
651 | + <?php wp_nonce_field('add-customer-note', 'add_customer_note_nonce', true, true); ?> |
|
652 | 652 | <input id="add-customer-note" class="right button-primary" type="submit" value="Add Note" /> |
653 | 653 | </form> |
654 | 654 | </div> |
@@ -663,26 +663,26 @@ discard block |
||
663 | 663 | 'show_all' => true |
664 | 664 | ); |
665 | 665 | |
666 | - echo paginate_links( $pagination_args ); |
|
666 | + echo paginate_links($pagination_args); |
|
667 | 667 | ?> |
668 | 668 | |
669 | 669 | <div id="give-customer-notes" class="postbox"> |
670 | - <?php if ( count( $customer_notes ) > 0 ) { ?> |
|
671 | - <?php foreach ( $customer_notes as $key => $note ) : ?> |
|
670 | + <?php if (count($customer_notes) > 0) { ?> |
|
671 | + <?php foreach ($customer_notes as $key => $note) : ?> |
|
672 | 672 | <div class="customer-note-wrapper dashboard-comment-wrap comment-item"> |
673 | 673 | <span class="note-content-wrap"> |
674 | - <?php echo stripslashes( $note ); ?> |
|
674 | + <?php echo stripslashes($note); ?> |
|
675 | 675 | </span> |
676 | 676 | </div> |
677 | 677 | <?php endforeach; ?> |
678 | 678 | <?php } else { ?> |
679 | 679 | <div class="give-no-customer-notes"> |
680 | - <?php esc_html_e( 'No donor notes found.', 'give' ); ?> |
|
680 | + <?php esc_html_e('No donor notes found.', 'give'); ?> |
|
681 | 681 | </div> |
682 | 682 | <?php } ?> |
683 | 683 | </div> |
684 | 684 | |
685 | - <?php echo paginate_links( $pagination_args ); ?> |
|
685 | + <?php echo paginate_links($pagination_args); ?> |
|
686 | 686 | |
687 | 687 | </div> |
688 | 688 | |
@@ -698,9 +698,9 @@ discard block |
||
698 | 698 | * |
699 | 699 | * @return void |
700 | 700 | */ |
701 | -function give_customers_delete_view( $customer ) { |
|
701 | +function give_customers_delete_view($customer) { |
|
702 | 702 | |
703 | - $customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' ); |
|
703 | + $customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments'); |
|
704 | 704 | |
705 | 705 | /** |
706 | 706 | * Fires in donor delete screen, above the content. |
@@ -709,15 +709,15 @@ discard block |
||
709 | 709 | * |
710 | 710 | * @param object $customer The customer object being displayed. |
711 | 711 | */ |
712 | - do_action( 'give_customer_delete_top', $customer ); |
|
712 | + do_action('give_customer_delete_top', $customer); |
|
713 | 713 | ?> |
714 | 714 | |
715 | 715 | <div class="info-wrapper customer-section"> |
716 | 716 | |
717 | - <form id="delete-customer" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $customer->id ); ?>"> |
|
717 | + <form id="delete-customer" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$customer->id); ?>"> |
|
718 | 718 | |
719 | 719 | <div class="customer-notes-header"> |
720 | - <?php echo get_avatar( $customer->email, 30 ); ?> <span><?php echo $customer->name; ?></span> |
|
720 | + <?php echo get_avatar($customer->email, 30); ?> <span><?php echo $customer->name; ?></span> |
|
721 | 721 | </div> |
722 | 722 | |
723 | 723 | |
@@ -725,16 +725,16 @@ discard block |
||
725 | 725 | |
726 | 726 | <span class="delete-customer-options"> |
727 | 727 | <p> |
728 | - <?php echo Give()->html->checkbox( array( 'name' => 'give-customer-delete-confirm' ) ); ?> |
|
729 | - <label for="give-customer-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label> |
|
728 | + <?php echo Give()->html->checkbox(array('name' => 'give-customer-delete-confirm')); ?> |
|
729 | + <label for="give-customer-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label> |
|
730 | 730 | </p> |
731 | 731 | |
732 | 732 | <p> |
733 | - <?php echo Give()->html->checkbox( array( |
|
733 | + <?php echo Give()->html->checkbox(array( |
|
734 | 734 | 'name' => 'give-customer-delete-records', |
735 | - 'options' => array( 'disabled' => true ) |
|
736 | - ) ); ?> |
|
737 | - <label for="give-customer-delete-records"><?php esc_html_e( 'Delete all associated donations and records?', 'give' ); ?></label> |
|
735 | + 'options' => array('disabled' => true) |
|
736 | + )); ?> |
|
737 | + <label for="give-customer-delete-records"><?php esc_html_e('Delete all associated donations and records?', 'give'); ?></label> |
|
738 | 738 | </p> |
739 | 739 | |
740 | 740 | <?php |
@@ -747,16 +747,16 @@ discard block |
||
747 | 747 | * |
748 | 748 | * @param object $customer The customer object being displayed. |
749 | 749 | */ |
750 | - do_action( 'give_customer_delete_inputs', $customer ); |
|
750 | + do_action('give_customer_delete_inputs', $customer); |
|
751 | 751 | ?> |
752 | 752 | </span> |
753 | 753 | |
754 | 754 | <span id="customer-edit-actions"> |
755 | 755 | <input type="hidden" name="customer_id" value="<?php echo $customer->id; ?>" /> |
756 | - <?php wp_nonce_field( 'delete-customer', '_wpnonce', false, true ); ?> |
|
756 | + <?php wp_nonce_field('delete-customer', '_wpnonce', false, true); ?> |
|
757 | 757 | <input type="hidden" name="give_action" value="delete-customer" /> |
758 | - <input type="submit" disabled="disabled" id="give-delete-customer" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" /> |
|
759 | - <a id="give-delete-customer-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
758 | + <input type="submit" disabled="disabled" id="give-delete-customer" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" /> |
|
759 | + <a id="give-delete-customer-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?>" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
760 | 760 | </span> |
761 | 761 | |
762 | 762 | </div> |
@@ -772,5 +772,5 @@ discard block |
||
772 | 772 | * |
773 | 773 | * @param object $customer The customer object being displayed. |
774 | 774 | */ |
775 | - do_action( 'give_customer_delete_bottom', $customer ); |
|
775 | + do_action('give_customer_delete_bottom', $customer); |
|
776 | 776 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function give_payment_history_page() { |
27 | 27 | |
28 | - $give_payment = get_post_type_object( 'give_payment' ); |
|
28 | + $give_payment = get_post_type_object('give_payment'); |
|
29 | 29 | |
30 | - if ( isset( $_GET['view'] ) && 'view-order-details' == $_GET['view'] ) { |
|
31 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/view-order-details.php'; |
|
30 | + if (isset($_GET['view']) && 'view-order-details' == $_GET['view']) { |
|
31 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/view-order-details.php'; |
|
32 | 32 | } else { |
33 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/class-payments-table.php'; |
|
33 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/class-payments-table.php'; |
|
34 | 34 | $payments_table = new Give_Payment_History_Table(); |
35 | 35 | $payments_table->prepare_items(); |
36 | 36 | ?> |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @since 1.7 |
46 | 46 | */ |
47 | - do_action( 'give_donations_page_top' ); |
|
47 | + do_action('give_donations_page_top'); |
|
48 | 48 | ?> |
49 | 49 | |
50 | - <form id="give-payments-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>"> |
|
50 | + <form id="give-payments-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>"> |
|
51 | 51 | <input type="hidden" name="post_type" value="give_forms" /> |
52 | 52 | <input type="hidden" name="page" value="give-payment-history" /> |
53 | 53 | <?php $payments_table->views() ?> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * |
62 | 62 | * @since 1.7 |
63 | 63 | */ |
64 | - do_action( 'give_donations_page_bottom' ); |
|
64 | + do_action('give_donations_page_bottom'); |
|
65 | 65 | ?> |
66 | 66 | |
67 | 67 | </div> |
@@ -78,29 +78,29 @@ discard block |
||
78 | 78 | * @param $title |
79 | 79 | * @return string |
80 | 80 | */ |
81 | -function give_view_order_details_title( $admin_title, $title ) { |
|
81 | +function give_view_order_details_title($admin_title, $title) { |
|
82 | 82 | |
83 | - if ( 'give_forms_page_give-payment-history' != get_current_screen()->base ) { |
|
83 | + if ('give_forms_page_give-payment-history' != get_current_screen()->base) { |
|
84 | 84 | return $admin_title; |
85 | 85 | } |
86 | 86 | |
87 | - if( ! isset( $_GET['give-action'] ) ) { |
|
87 | + if ( ! isset($_GET['give-action'])) { |
|
88 | 88 | return $admin_title; |
89 | 89 | } |
90 | 90 | |
91 | - switch( $_GET['give-action'] ) : |
|
91 | + switch ($_GET['give-action']) : |
|
92 | 92 | |
93 | 93 | case 'view-order-details' : |
94 | 94 | $title = sprintf( |
95 | 95 | /* translators: %s: admin title */ |
96 | - esc_html__( 'View Donation Details - %s', 'give' ), |
|
96 | + esc_html__('View Donation Details - %s', 'give'), |
|
97 | 97 | $admin_title |
98 | 98 | ); |
99 | 99 | break; |
100 | 100 | case 'edit-payment' : |
101 | 101 | $title = sprintf( |
102 | 102 | /* translators: %s: admin title */ |
103 | - esc_html__( 'Edit Donation - %s', 'give' ), |
|
103 | + esc_html__('Edit Donation - %s', 'give'), |
|
104 | 104 | $admin_title |
105 | 105 | ); |
106 | 106 | break; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | return $title; |
113 | 113 | } |
114 | -add_filter( 'admin_title', 'give_view_order_details_title', 10, 2 ); |
|
114 | +add_filter('admin_title', 'give_view_order_details_title', 10, 2); |
|
115 | 115 | |
116 | 116 | /** |
117 | 117 | * Intercept default Edit post links for Give payments and rewrite them to the View Order Details screen |
@@ -123,20 +123,20 @@ discard block |
||
123 | 123 | * @param $context |
124 | 124 | * @return string |
125 | 125 | */ |
126 | -function give_override_edit_post_for_payment_link( $url, $post_id = 0, $context ) { |
|
126 | +function give_override_edit_post_for_payment_link($url, $post_id = 0, $context) { |
|
127 | 127 | |
128 | - $post = get_post( $post_id ); |
|
128 | + $post = get_post($post_id); |
|
129 | 129 | |
130 | - if( ! $post ) { |
|
130 | + if ( ! $post) { |
|
131 | 131 | return $url; |
132 | 132 | } |
133 | 133 | |
134 | - if( 'give_payment' != $post->post_type ) { |
|
134 | + if ('give_payment' != $post->post_type) { |
|
135 | 135 | return $url; |
136 | 136 | } |
137 | 137 | |
138 | - $url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $post_id ); |
|
138 | + $url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$post_id); |
|
139 | 139 | |
140 | 140 | return $url; |
141 | 141 | } |
142 | -add_filter( 'get_edit_post_link', 'give_override_edit_post_for_payment_link', 10, 3 ); |
|
142 | +add_filter('get_edit_post_link', 'give_override_edit_post_for_payment_link', 10, 3); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -20,27 +20,27 @@ discard block |
||
20 | 20 | * @since 1.0 |
21 | 21 | * @return void |
22 | 22 | */ |
23 | -if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
24 | - wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
23 | +if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
24 | + wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | // Setup the variables |
28 | -$payment_id = absint( $_GET['id'] ); |
|
29 | -$payment = new Give_Payment( $payment_id ); |
|
28 | +$payment_id = absint($_GET['id']); |
|
29 | +$payment = new Give_Payment($payment_id); |
|
30 | 30 | |
31 | 31 | // Sanity check... fail if donation ID is invalid |
32 | 32 | $payment_exists = $payment->ID; |
33 | -if ( empty( $payment_exists ) ) { |
|
34 | - wp_die( esc_html__( 'The specified ID does not belong to a donation. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
33 | +if (empty($payment_exists)) { |
|
34 | + wp_die(esc_html__('The specified ID does not belong to a donation. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $number = $payment->number; |
38 | 38 | $payment_meta = $payment->get_meta(); |
39 | -$transaction_id = esc_attr( $payment->transaction_id ); |
|
39 | +$transaction_id = esc_attr($payment->transaction_id); |
|
40 | 40 | $user_id = $payment->user_id; |
41 | 41 | $customer_id = $payment->customer_id; |
42 | -$payment_date = strtotime( $payment->date ); |
|
43 | -$user_info = give_get_payment_meta_user_info( $payment_id ); |
|
42 | +$payment_date = strtotime($payment->date); |
|
43 | +$user_info = give_get_payment_meta_user_info($payment_id); |
|
44 | 44 | $address = $payment->address; |
45 | 45 | $gateway = $payment->gateway; |
46 | 46 | $currency_code = $payment->currency; |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | <h1 id="transaction-details-heading"><?php |
54 | 54 | printf( |
55 | 55 | /* translators: %s: donation number */ |
56 | - esc_html__( 'Donation %s', 'give' ), |
|
56 | + esc_html__('Donation %s', 'give'), |
|
57 | 57 | $number |
58 | 58 | ); |
59 | - if ( $payment_mode == 'test' ) { |
|
60 | - echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Donation', 'give' ) . '</span>'; |
|
59 | + if ($payment_mode == 'test') { |
|
60 | + echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Donation', 'give').'</span>'; |
|
61 | 61 | } |
62 | 62 | ?></h1> |
63 | 63 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @param int $payment_id Payment id. |
71 | 71 | */ |
72 | - do_action( 'give_view_order_details_before', $payment_id ); |
|
72 | + do_action('give_view_order_details_before', $payment_id); |
|
73 | 73 | ?> |
74 | 74 | <form id="give-edit-order-form" method="post"> |
75 | 75 | <?php |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @param int $payment_id Payment id. |
82 | 82 | */ |
83 | - do_action( 'give_view_order_details_form_top', $payment_id ); |
|
83 | + do_action('give_view_order_details_form_top', $payment_id); |
|
84 | 84 | ?> |
85 | 85 | <div id="poststuff"> |
86 | 86 | <div id="give-dashboard-widgets-wrap"> |
@@ -96,12 +96,12 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param int $payment_id Payment id. |
98 | 98 | */ |
99 | - do_action( 'give_view_order_details_sidebar_before', $payment_id ); |
|
99 | + do_action('give_view_order_details_sidebar_before', $payment_id); |
|
100 | 100 | ?> |
101 | 101 | |
102 | 102 | <div id="give-order-update" class="postbox give-order-data"> |
103 | 103 | |
104 | - <h3 class="hndle"><?php esc_html_e( 'Update Donation', 'give' ); ?></h3> |
|
104 | + <h3 class="hndle"><?php esc_html_e('Update Donation', 'give'); ?></h3> |
|
105 | 105 | |
106 | 106 | <div class="inside"> |
107 | 107 | <div class="give-admin-box"> |
@@ -114,33 +114,33 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @param int $payment_id Payment id. |
116 | 116 | */ |
117 | - do_action( 'give_view_order_details_totals_before', $payment_id ); |
|
117 | + do_action('give_view_order_details_totals_before', $payment_id); |
|
118 | 118 | ?> |
119 | 119 | |
120 | 120 | <div class="give-admin-box-inside"> |
121 | 121 | <p> |
122 | - <label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label> |
|
122 | + <label for="give-payment-status" class="strong"><?php esc_html_e('Status:', 'give'); ?></label> |
|
123 | 123 | <select id="give-payment-status" name="give-payment-status" class="medium-text"> |
124 | - <?php foreach ( give_get_payment_statuses() as $key => $status ) : ?> |
|
125 | - <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option> |
|
124 | + <?php foreach (give_get_payment_statuses() as $key => $status) : ?> |
|
125 | + <option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option> |
|
126 | 126 | <?php endforeach; ?> |
127 | 127 | </select> |
128 | - <span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span> |
|
128 | + <span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span> |
|
129 | 129 | </p> |
130 | 130 | </div> |
131 | 131 | |
132 | 132 | <div class="give-admin-box-inside"> |
133 | 133 | <p> |
134 | - <label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label> |
|
135 | - <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/> |
|
134 | + <label for="give-payment-date" class="strong"><?php esc_html_e('Date:', 'give'); ?></label> |
|
135 | + <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/> |
|
136 | 136 | </p> |
137 | 137 | </div> |
138 | 138 | |
139 | 139 | <div class="give-admin-box-inside"> |
140 | 140 | <p> |
141 | - <label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label> |
|
142 | - <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/> : |
|
143 | - <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/> |
|
141 | + <label for="give-payment-time-hour" class="strong"><?php esc_html_e('Time:', 'give'); ?></label> |
|
142 | + <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/> : |
|
143 | + <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/> |
|
144 | 144 | </p> |
145 | 145 | </div> |
146 | 146 | |
@@ -154,18 +154,18 @@ discard block |
||
154 | 154 | * |
155 | 155 | * @param int $payment_id Payment id. |
156 | 156 | */ |
157 | - do_action( 'give_view_order_details_update_inner', $payment_id ); |
|
157 | + do_action('give_view_order_details_update_inner', $payment_id); |
|
158 | 158 | |
159 | 159 | //@TODO: Fees |
160 | - $fees = give_get_payment_fees( $payment_id ); |
|
161 | - if ( ! empty( $fees ) ) : ?> |
|
160 | + $fees = give_get_payment_fees($payment_id); |
|
161 | + if ( ! empty($fees)) : ?> |
|
162 | 162 | <div class="give-order-fees give-admin-box-inside"> |
163 | - <p class="strong"><?php esc_html_e( 'Fees:', 'give' ); ?></p> |
|
163 | + <p class="strong"><?php esc_html_e('Fees:', 'give'); ?></p> |
|
164 | 164 | <ul class="give-payment-fees"> |
165 | - <?php foreach ( $fees as $fee ) : ?> |
|
165 | + <?php foreach ($fees as $fee) : ?> |
|
166 | 166 | <li> |
167 | 167 | <span class="fee-label"><?php echo $fee['label']; ?>:</span> |
168 | - <span class="fee-amount" data-fee="<?php echo esc_attr( $fee['amount'] ); ?>"><?php echo give_currency_filter( $fee['amount'], $currency_code ); ?></span> |
|
168 | + <span class="fee-amount" data-fee="<?php echo esc_attr($fee['amount']); ?>"><?php echo give_currency_filter($fee['amount'], $currency_code); ?></span> |
|
169 | 169 | </li> |
170 | 170 | <?php endforeach; ?> |
171 | 171 | </ul> |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | |
175 | 175 | <div class="give-order-payment give-admin-box-inside"> |
176 | 176 | <p> |
177 | - <label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label> |
|
178 | - <?php echo give_currency_symbol( $payment->currency ); ?> <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/> |
|
177 | + <label for="give-payment-total" class="strong"><?php esc_html_e('Total Donation:', 'give'); ?></label> |
|
178 | + <?php echo give_currency_symbol($payment->currency); ?> <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/> |
|
179 | 179 | </p> |
180 | 180 | </div> |
181 | 181 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * |
188 | 188 | * @param int $payment_id Payment id. |
189 | 189 | */ |
190 | - do_action( 'give_view_order_details_totals_after', $payment_id ); |
|
190 | + do_action('give_view_order_details_totals_after', $payment_id); |
|
191 | 191 | ?> |
192 | 192 | |
193 | 193 | </div> |
@@ -205,17 +205,17 @@ discard block |
||
205 | 205 | * |
206 | 206 | * @param int $payment_id Payment id. |
207 | 207 | */ |
208 | - do_action( 'give_view_order_details_update_before', $payment_id ); |
|
208 | + do_action('give_view_order_details_update_before', $payment_id); |
|
209 | 209 | ?> |
210 | 210 | |
211 | 211 | <div id="major-publishing-actions"> |
212 | 212 | <div id="publishing-action"> |
213 | - <input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/> |
|
214 | - <?php if ( give_is_payment_complete( $payment_id ) ) : ?> |
|
215 | - <a href="<?php echo esc_url( add_query_arg( array( |
|
213 | + <input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Donation', 'give'); ?>"/> |
|
214 | + <?php if (give_is_payment_complete($payment_id)) : ?> |
|
215 | + <a href="<?php echo esc_url(add_query_arg(array( |
|
216 | 216 | 'give-action' => 'email_links', |
217 | 217 | 'purchase_id' => $payment_id |
218 | - ) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a> |
|
218 | + ))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a> |
|
219 | 219 | <?php endif; ?> |
220 | 220 | </div> |
221 | 221 | <div class="clear"></div> |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * |
230 | 230 | * @param int $payment_id Payment id. |
231 | 231 | */ |
232 | - do_action( 'give_view_order_details_update_after', $payment_id ); |
|
232 | + do_action('give_view_order_details_update_after', $payment_id); |
|
233 | 233 | ?> |
234 | 234 | |
235 | 235 | </div> |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | <div id="give-order-details" class="postbox give-order-data"> |
242 | 242 | |
243 | - <h3 class="hndle"><?php esc_html_e( 'Donation Meta', 'give' ); ?></h3> |
|
243 | + <h3 class="hndle"><?php esc_html_e('Donation Meta', 'give'); ?></h3> |
|
244 | 244 | |
245 | 245 | <div class="inside"> |
246 | 246 | <div class="give-admin-box"> |
@@ -253,44 +253,44 @@ discard block |
||
253 | 253 | * |
254 | 254 | * @param int $payment_id Payment id. |
255 | 255 | */ |
256 | - do_action( 'give_view_order_details_payment_meta_before', $payment_id ); |
|
256 | + do_action('give_view_order_details_payment_meta_before', $payment_id); |
|
257 | 257 | |
258 | - $gateway = give_get_payment_gateway( $payment_id ); |
|
259 | - if ( $gateway ) : ?> |
|
258 | + $gateway = give_get_payment_gateway($payment_id); |
|
259 | + if ($gateway) : ?> |
|
260 | 260 | <div class="give-order-gateway give-admin-box-inside"> |
261 | 261 | <p> |
262 | - <strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong> |
|
263 | - <?php echo give_get_gateway_admin_label( $gateway ); ?> |
|
262 | + <strong><?php esc_html_e('Gateway:', 'give'); ?></strong> |
|
263 | + <?php echo give_get_gateway_admin_label($gateway); ?> |
|
264 | 264 | </p> |
265 | 265 | </div> |
266 | 266 | <?php endif; ?> |
267 | 267 | |
268 | 268 | <div class="give-order-payment-key give-admin-box-inside"> |
269 | 269 | <p> |
270 | - <strong><?php esc_html_e( 'Key:', 'give' ); ?></strong> |
|
271 | - <?php echo give_get_payment_key( $payment_id ); ?> |
|
270 | + <strong><?php esc_html_e('Key:', 'give'); ?></strong> |
|
271 | + <?php echo give_get_payment_key($payment_id); ?> |
|
272 | 272 | </p> |
273 | 273 | </div> |
274 | 274 | |
275 | 275 | <div class="give-order-ip give-admin-box-inside"> |
276 | 276 | <p> |
277 | - <strong><?php esc_html_e( 'IP:', 'give' ); ?></strong> |
|
278 | - <?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?> |
|
277 | + <strong><?php esc_html_e('IP:', 'give'); ?></strong> |
|
278 | + <?php echo esc_html(give_get_payment_user_ip($payment_id)); ?> |
|
279 | 279 | </p> |
280 | 280 | </div> |
281 | 281 | |
282 | - <?php if ( $transaction_id ) : ?> |
|
282 | + <?php if ($transaction_id) : ?> |
|
283 | 283 | <div class="give-order-tx-id give-admin-box-inside"> |
284 | 284 | <p> |
285 | - <strong><?php esc_html_e( 'Donation ID:', 'give' ); ?></strong> |
|
286 | - <?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?> |
|
285 | + <strong><?php esc_html_e('Donation ID:', 'give'); ?></strong> |
|
286 | + <?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?> |
|
287 | 287 | </p> |
288 | 288 | </div> |
289 | 289 | <?php endif; ?> |
290 | 290 | |
291 | 291 | <div class="give-admin-box-inside"> |
292 | - <p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?> |
|
293 | - <a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor »', 'give' ); ?></a> |
|
292 | + <p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?> |
|
293 | + <a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor »', 'give'); ?></a> |
|
294 | 294 | </p> |
295 | 295 | </div> |
296 | 296 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * |
303 | 303 | * @param int $payment_id Payment id. |
304 | 304 | */ |
305 | - do_action( 'give_view_order_details_payment_meta_after', $payment_id ); |
|
305 | + do_action('give_view_order_details_payment_meta_after', $payment_id); |
|
306 | 306 | ?> |
307 | 307 | |
308 | 308 | </div> |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | * |
323 | 323 | * @param int $payment_id Payment id. |
324 | 324 | */ |
325 | - do_action( 'give_view_order_details_sidebar_after', $payment_id ); |
|
325 | + do_action('give_view_order_details_sidebar_after', $payment_id); |
|
326 | 326 | ?> |
327 | 327 | |
328 | 328 | </div> |
@@ -342,50 +342,50 @@ discard block |
||
342 | 342 | * |
343 | 343 | * @param int $payment_id Payment id. |
344 | 344 | */ |
345 | - do_action( 'give_view_order_details_main_before', $payment_id ); |
|
345 | + do_action('give_view_order_details_main_before', $payment_id); |
|
346 | 346 | ?> |
347 | 347 | |
348 | 348 | <?php $column_count = 'columns-3'; ?> |
349 | 349 | <div id="give-donation-overview" class="postbox <?php echo $column_count; ?>"> |
350 | - <h3 class="hndle"><?php esc_html_e( 'Donation Information', 'give' ); ?></h3> |
|
350 | + <h3 class="hndle"><?php esc_html_e('Donation Information', 'give'); ?></h3> |
|
351 | 351 | |
352 | 352 | <div class="inside"> |
353 | 353 | |
354 | 354 | <div class="column-container"> |
355 | 355 | <div class="column"> |
356 | 356 | <p> |
357 | - <strong><?php esc_html_e( 'Donation Form ID:', 'give' ); ?></strong><br> |
|
357 | + <strong><?php esc_html_e('Donation Form ID:', 'give'); ?></strong><br> |
|
358 | 358 | <?php |
359 | - if ( $payment_meta['form_id'] ) : |
|
359 | + if ($payment_meta['form_id']) : |
|
360 | 360 | printf( |
361 | 361 | '<a href="%1$s" target="_blank">#%2$s</a>', |
362 | - admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ), |
|
362 | + admin_url('post.php?action=edit&post='.$payment_meta['form_id']), |
|
363 | 363 | $payment_meta['form_id'] |
364 | 364 | ); |
365 | 365 | endif; |
366 | 366 | ?> |
367 | 367 | </p> |
368 | 368 | <p> |
369 | - <strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br> |
|
370 | - <?php give_get_form_dropdown( array( |
|
369 | + <strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br> |
|
370 | + <?php give_get_form_dropdown(array( |
|
371 | 371 | 'id' => $payment_meta['form_id'], |
372 | 372 | 'selected' => $payment_meta['form_id'], |
373 | 373 | 'chosen' => true |
374 | - ), true ); ?> |
|
374 | + ), true); ?> |
|
375 | 375 | </p> |
376 | 376 | </div> |
377 | 377 | <div class="column"> |
378 | 378 | <p> |
379 | - <strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br> |
|
380 | - <?php echo date_i18n( give_date_format(), $payment_date ); ?> |
|
379 | + <strong><?php esc_html_e('Donation Date:', 'give'); ?></strong><br> |
|
380 | + <?php echo date_i18n(give_date_format(), $payment_date); ?> |
|
381 | 381 | </p> |
382 | 382 | <p> |
383 | - <strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br> |
|
383 | + <strong><?php esc_html_e('Donation Level:', 'give'); ?></strong><br> |
|
384 | 384 | <span class="give-donation-level"> |
385 | 385 | <?php |
386 | - $var_prices = give_has_variable_prices( $payment_meta['form_id'] ); |
|
387 | - if ( empty( $var_prices ) ) { |
|
388 | - esc_html_e( 'n/a', 'give' ); |
|
386 | + $var_prices = give_has_variable_prices($payment_meta['form_id']); |
|
387 | + if (empty($var_prices)) { |
|
388 | + esc_html_e('n/a', 'give'); |
|
389 | 389 | } else { |
390 | 390 | // Variable price dropdown options. |
391 | 391 | $variable_price_dropdown_option = array( |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | 'selected' => $payment_meta['price_id'], |
397 | 397 | ); |
398 | 398 | // Render variable prices select tag html. |
399 | - give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); |
|
399 | + give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); |
|
400 | 400 | } |
401 | 401 | ?> |
402 | 402 | </span> |
@@ -404,8 +404,8 @@ discard block |
||
404 | 404 | </div> |
405 | 405 | <div class="column"> |
406 | 406 | <p> |
407 | - <strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br> |
|
408 | - <?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?> |
|
407 | + <strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br> |
|
408 | + <?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?> |
|
409 | 409 | </p> |
410 | 410 | <p> |
411 | 411 | <?php |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @param int $payment_id Payment id. |
420 | 420 | */ |
421 | - do_action( 'give_donation_details_thead_before', $payment_id ); |
|
421 | + do_action('give_donation_details_thead_before', $payment_id); |
|
422 | 422 | |
423 | 423 | |
424 | 424 | /** |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | * |
431 | 431 | * @param int $payment_id Payment id. |
432 | 432 | */ |
433 | - do_action( 'give_donation_details_thead_after', $payment_id ); |
|
433 | + do_action('give_donation_details_thead_after', $payment_id); |
|
434 | 434 | |
435 | 435 | /** |
436 | 436 | * Fires in order details page, in the donation-information metabox, before the body elements. |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | * |
442 | 442 | * @param int $payment_id Payment id. |
443 | 443 | */ |
444 | - do_action( 'give_donation_details_tbody_before', $payment_id ); |
|
444 | + do_action('give_donation_details_tbody_before', $payment_id); |
|
445 | 445 | |
446 | 446 | /** |
447 | 447 | * Fires in order details page, in the donation-information metabox, after the body elements. |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | * |
453 | 453 | * @param int $payment_id Payment id. |
454 | 454 | */ |
455 | - do_action( 'give_donation_details_tbody_after', $payment_id ); |
|
455 | + do_action('give_donation_details_tbody_after', $payment_id); |
|
456 | 456 | ?> |
457 | 457 | </p> |
458 | 458 | </div> |
@@ -472,57 +472,57 @@ discard block |
||
472 | 472 | * |
473 | 473 | * @param int $payment_id Payment id. |
474 | 474 | */ |
475 | - do_action( 'give_view_order_details_files_after', $payment_id ); |
|
475 | + do_action('give_view_order_details_files_after', $payment_id); |
|
476 | 476 | ?> |
477 | 477 | |
478 | 478 | <div id="give-donor-details" class="postbox"> |
479 | - <h3 class="hndle"><?php esc_html_e( 'Donor Details', 'give' ); ?></h3> |
|
479 | + <h3 class="hndle"><?php esc_html_e('Donor Details', 'give'); ?></h3> |
|
480 | 480 | |
481 | 481 | <div class="inside"> |
482 | 482 | |
483 | - <?php $customer = new Give_Customer( $customer_id ); ?> |
|
483 | + <?php $customer = new Give_Customer($customer_id); ?> |
|
484 | 484 | |
485 | 485 | <div class="column-container customer-info"> |
486 | 486 | <div class="column"> |
487 | 487 | <p> |
488 | - <strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br> |
|
488 | + <strong><?php esc_html_e('Donor ID:', 'give'); ?></strong><br> |
|
489 | 489 | <?php |
490 | - if ( ! empty( $customer->id ) ) { |
|
490 | + if ( ! empty($customer->id)) { |
|
491 | 491 | printf( |
492 | 492 | '<a href="%1$s" target="_blank">#%2$s</a>', |
493 | - admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ), |
|
493 | + admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id), |
|
494 | 494 | $customer->id |
495 | 495 | ); |
496 | 496 | } |
497 | 497 | ?> |
498 | 498 | </p> |
499 | 499 | <p> |
500 | - <strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br> |
|
501 | - <?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?> |
|
500 | + <strong><?php esc_html_e('Donor Since:', 'give'); ?></strong><br> |
|
501 | + <?php echo date_i18n(give_date_format(), strtotime($customer->date_created)) ?> |
|
502 | 502 | </p> |
503 | 503 | </div> |
504 | 504 | <div class="column"> |
505 | 505 | <p> |
506 | - <strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br> |
|
506 | + <strong><?php esc_html_e('Donor Name:', 'give'); ?></strong><br> |
|
507 | 507 | <?php echo $customer->name; ?> |
508 | 508 | </p> |
509 | 509 | <p> |
510 | - <strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br> |
|
510 | + <strong><?php esc_html_e('Donor Email:', 'give'); ?></strong><br> |
|
511 | 511 | <?php echo $customer->email; ?> |
512 | 512 | </p> |
513 | 513 | </div> |
514 | 514 | <div class="column"> |
515 | 515 | <p> |
516 | - <strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br> |
|
516 | + <strong><?php esc_html_e('Change Donor:', 'give'); ?></strong><br> |
|
517 | 517 | <?php |
518 | - echo Give()->html->donor_dropdown( array( |
|
518 | + echo Give()->html->donor_dropdown(array( |
|
519 | 519 | 'selected' => $customer->id, |
520 | 520 | 'name' => 'customer-id' |
521 | - ) ); |
|
521 | + )); |
|
522 | 522 | ?> |
523 | 523 | </p> |
524 | 524 | <p> |
525 | - <a href="#new" class="give-payment-new-customer"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a> |
|
525 | + <a href="#new" class="give-payment-new-customer"><?php esc_html_e('Create New Donor', 'give'); ?></a> |
|
526 | 526 | </p> |
527 | 527 | </div> |
528 | 528 | </div> |
@@ -530,13 +530,13 @@ discard block |
||
530 | 530 | <div class="column-container new-customer" style="display: none"> |
531 | 531 | <div class="column"> |
532 | 532 | <p> |
533 | - <label for="give-new-customer-name"><?php esc_html_e( 'New Donor Name:', 'give' ); ?></label> |
|
533 | + <label for="give-new-customer-name"><?php esc_html_e('New Donor Name:', 'give'); ?></label> |
|
534 | 534 | <input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/> |
535 | 535 | </p> |
536 | 536 | </div> |
537 | 537 | <div class="column"> |
538 | 538 | <p> |
539 | - <label for="give-new-customer-email"><?php esc_html_e( 'New Donor Email:', 'give' ); ?></label> |
|
539 | + <label for="give-new-customer-email"><?php esc_html_e('New Donor Email:', 'give'); ?></label> |
|
540 | 540 | <input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/> |
541 | 541 | </p> |
542 | 542 | </div> |
@@ -544,9 +544,9 @@ discard block |
||
544 | 544 | <p> |
545 | 545 | <input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/> |
546 | 546 | <input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/> |
547 | - <a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
547 | + <a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
548 | 548 | <br> |
549 | - <em><?php esc_html_e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em> |
|
549 | + <em><?php esc_html_e('Click "Save Donation" to create new donor.', 'give'); ?></em> |
|
550 | 550 | </p> |
551 | 551 | </div> |
552 | 552 | </div> |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | * @param array $payment_meta Payment meta. |
563 | 563 | * @param array $user_info User information. |
564 | 564 | */ |
565 | - do_action( 'give_donation_personal_details_list', $payment_meta, $user_info ); |
|
565 | + do_action('give_donation_personal_details_list', $payment_meta, $user_info); |
|
566 | 566 | |
567 | 567 | /** |
568 | 568 | * Fires in order details page, in the donor-details metabox. |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | * |
572 | 572 | * @param int $payment_id Payment id. |
573 | 573 | */ |
574 | - do_action( 'give_donation_view_details', $payment_id ); |
|
574 | + do_action('give_donation_view_details', $payment_id); |
|
575 | 575 | ?> |
576 | 576 | |
577 | 577 | </div> |
@@ -587,11 +587,11 @@ discard block |
||
587 | 587 | * |
588 | 588 | * @param int $payment_id Payment id. |
589 | 589 | */ |
590 | - do_action( 'give_view_order_details_billing_before', $payment_id ); |
|
590 | + do_action('give_view_order_details_billing_before', $payment_id); |
|
591 | 591 | ?> |
592 | 592 | |
593 | 593 | <div id="give-billing-details" class="postbox"> |
594 | - <h3 class="hndle"><?php esc_html_e( 'Billing Address', 'give' ); ?></h3> |
|
594 | + <h3 class="hndle"><?php esc_html_e('Billing Address', 'give'); ?></h3> |
|
595 | 595 | |
596 | 596 | <div class="inside"> |
597 | 597 | |
@@ -601,57 +601,57 @@ discard block |
||
601 | 601 | <div class="data column-container"> |
602 | 602 | <div class="column"> |
603 | 603 | <div class="give-wrap-address-line1"> |
604 | - <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1:', 'give' ); ?></label> |
|
605 | - <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/> |
|
604 | + <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Address 1:', 'give'); ?></label> |
|
605 | + <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/> |
|
606 | 606 | </div> |
607 | 607 | <div class="give-wrap-address-line2"> |
608 | - <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2:', 'give' ); ?></label> |
|
609 | - <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/> |
|
608 | + <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Address 2:', 'give'); ?></label> |
|
609 | + <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/> |
|
610 | 610 | </div> |
611 | 611 | </div> |
612 | 612 | <div class="column"> |
613 | 613 | <div class="give-wrap-address-city"> |
614 | - <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label> |
|
615 | - <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/> |
|
614 | + <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label> |
|
615 | + <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/> |
|
616 | 616 | </div> |
617 | 617 | <div class="give-wrap-address-zip"> |
618 | - <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label> |
|
619 | - <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/> |
|
618 | + <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label> |
|
619 | + <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/> |
|
620 | 620 | |
621 | 621 | </div> |
622 | 622 | </div> |
623 | 623 | <div class="column"> |
624 | 624 | <div id="give-order-address-country-wrap"> |
625 | - <label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label> |
|
625 | + <label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label> |
|
626 | 626 | <?php |
627 | - echo Give()->html->select( array( |
|
627 | + echo Give()->html->select(array( |
|
628 | 628 | 'options' => give_get_country_list(), |
629 | 629 | 'name' => 'give-payment-address[0][country]', |
630 | 630 | 'selected' => $address['country'], |
631 | 631 | 'show_option_all' => false, |
632 | 632 | 'show_option_none' => false, |
633 | 633 | 'chosen' => true, |
634 | - 'placeholder' => esc_attr__( 'Select a country', 'give' ) |
|
635 | - ) ); |
|
634 | + 'placeholder' => esc_attr__('Select a country', 'give') |
|
635 | + )); |
|
636 | 636 | ?> |
637 | 637 | </div> |
638 | 638 | <div id="give-order-address-state-wrap"> |
639 | - <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label> |
|
639 | + <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label> |
|
640 | 640 | <?php |
641 | - $states = give_get_states( $address['country'] ); |
|
642 | - if ( ! empty( $states ) ) { |
|
643 | - echo Give()->html->select( array( |
|
641 | + $states = give_get_states($address['country']); |
|
642 | + if ( ! empty($states)) { |
|
643 | + echo Give()->html->select(array( |
|
644 | 644 | 'options' => $states, |
645 | 645 | 'name' => 'give-payment-address[0][state]', |
646 | 646 | 'selected' => $address['state'], |
647 | 647 | 'show_option_all' => false, |
648 | 648 | 'show_option_none' => false, |
649 | 649 | 'chosen' => true, |
650 | - 'placeholder' => esc_attr__( 'Select a state', 'give' ) |
|
651 | - ) ); |
|
650 | + 'placeholder' => esc_attr__('Select a state', 'give') |
|
651 | + )); |
|
652 | 652 | } else { |
653 | 653 | ?> |
654 | - <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/> |
|
654 | + <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/> |
|
655 | 655 | <?php |
656 | 656 | } ?> |
657 | 657 | </div> |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | * |
672 | 672 | * @param int $payment_id Payment id. |
673 | 673 | */ |
674 | - do_action( 'give_donation_billing_details', $payment_id ); |
|
674 | + do_action('give_donation_billing_details', $payment_id); |
|
675 | 675 | ?> |
676 | 676 | |
677 | 677 | </div> |
@@ -687,32 +687,32 @@ discard block |
||
687 | 687 | * |
688 | 688 | * @param int $payment_id Payment id. |
689 | 689 | */ |
690 | - do_action( 'give_view_order_details_billing_after', $payment_id ); |
|
690 | + do_action('give_view_order_details_billing_after', $payment_id); |
|
691 | 691 | ?> |
692 | 692 | |
693 | 693 | <div id="give-payment-notes" class="postbox"> |
694 | - <h3 class="hndle"><?php esc_html_e( 'Donation Notes', 'give' ); ?></h3> |
|
694 | + <h3 class="hndle"><?php esc_html_e('Donation Notes', 'give'); ?></h3> |
|
695 | 695 | |
696 | 696 | <div class="inside"> |
697 | 697 | <div id="give-payment-notes-inner"> |
698 | 698 | <?php |
699 | - $notes = give_get_payment_notes( $payment_id ); |
|
700 | - if ( ! empty( $notes ) ) { |
|
699 | + $notes = give_get_payment_notes($payment_id); |
|
700 | + if ( ! empty($notes)) { |
|
701 | 701 | $no_notes_display = ' style="display:none;"'; |
702 | - foreach ( $notes as $note ) : |
|
702 | + foreach ($notes as $note) : |
|
703 | 703 | |
704 | - echo give_get_payment_note_html( $note, $payment_id ); |
|
704 | + echo give_get_payment_note_html($note, $payment_id); |
|
705 | 705 | |
706 | 706 | endforeach; |
707 | 707 | } else { |
708 | 708 | $no_notes_display = ''; |
709 | 709 | } |
710 | - echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>'; ?> |
|
710 | + echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>'; ?> |
|
711 | 711 | </div> |
712 | 712 | <textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea> |
713 | 713 | |
714 | 714 | <div class="give-clearfix"> |
715 | - <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button> |
|
715 | + <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button> |
|
716 | 716 | </div> |
717 | 717 | |
718 | 718 | </div> |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | * |
729 | 729 | * @param int $payment_id Payment id. |
730 | 730 | */ |
731 | - do_action( 'give_view_order_details_main_after', $payment_id ); |
|
731 | + do_action('give_view_order_details_main_after', $payment_id); |
|
732 | 732 | ?> |
733 | 733 | |
734 | 734 | </div> |
@@ -750,11 +750,11 @@ discard block |
||
750 | 750 | * |
751 | 751 | * @param int $payment_id Payment id. |
752 | 752 | */ |
753 | - do_action( 'give_view_order_details_form_bottom', $payment_id ); |
|
753 | + do_action('give_view_order_details_form_bottom', $payment_id); |
|
754 | 754 | |
755 | - wp_nonce_field( 'give_update_payment_details_nonce' ); |
|
755 | + wp_nonce_field('give_update_payment_details_nonce'); |
|
756 | 756 | ?> |
757 | - <input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/> |
|
757 | + <input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/> |
|
758 | 758 | <input type="hidden" name="give_action" value="update_payment_details"/> |
759 | 759 | </form> |
760 | 760 | <?php |
@@ -765,6 +765,6 @@ discard block |
||
765 | 765 | * |
766 | 766 | * @param int $payment_id Payment id. |
767 | 767 | */ |
768 | - do_action( 'give_view_order_details_after', $payment_id ); |
|
768 | + do_action('give_view_order_details_after', $payment_id); |
|
769 | 769 | ?> |
770 | 770 | </div><!-- /.wrap --> |