@@ -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 | |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @since 1.0 |
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | - add_action( 'admin_notices', array( $this, 'show_notices' ) ); |
|
31 | - add_action( 'give_dismiss_notices', array( $this, 'dismiss_notices' ) ); |
|
32 | - add_action( 'admin_bar_menu', array( $this, 'give_admin_bar_menu' ), 1000, 1 ); |
|
30 | + add_action('admin_notices', array($this, 'show_notices')); |
|
31 | + add_action('give_dismiss_notices', array($this, 'dismiss_notices')); |
|
32 | + add_action('admin_bar_menu', array($this, 'give_admin_bar_menu'), 1000, 1); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -40,20 +40,20 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return bool |
42 | 42 | */ |
43 | - public function give_admin_bar_menu( $wp_admin_bar ) { |
|
43 | + public function give_admin_bar_menu($wp_admin_bar) { |
|
44 | 44 | |
45 | - if ( ! give_is_test_mode() || ! current_user_can( 'view_give_reports' ) ) { |
|
45 | + if ( ! give_is_test_mode() || ! current_user_can('view_give_reports')) { |
|
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
49 | 49 | //Add the main siteadmin menu item. |
50 | - $wp_admin_bar->add_menu( array( |
|
50 | + $wp_admin_bar->add_menu(array( |
|
51 | 51 | 'id' => 'give-test-notice', |
52 | - 'href' => admin_url() . 'edit.php?post_type=give_forms&page=give-settings&tab=gateways', |
|
52 | + 'href' => admin_url().'edit.php?post_type=give_forms&page=give-settings&tab=gateways', |
|
53 | 53 | 'parent' => 'top-secondary', |
54 | - 'title' => esc_html__( 'Give Test Mode Active', 'give' ), |
|
55 | - 'meta' => array( 'class' => 'give-test-mode-active' ), |
|
56 | - ) ); |
|
54 | + 'title' => esc_html__('Give Test Mode Active', 'give'), |
|
55 | + 'meta' => array('class' => 'give-test-mode-active'), |
|
56 | + )); |
|
57 | 57 | |
58 | 58 | } |
59 | 59 | |
@@ -68,118 +68,118 @@ discard block |
||
68 | 68 | 'error' => array() |
69 | 69 | ); |
70 | 70 | |
71 | - if ( ! give_test_ajax_works() && ! get_user_meta( get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true ) && current_user_can( 'manage_give_settings' ) ) { |
|
71 | + if ( ! give_test_ajax_works() && ! get_user_meta(get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true) && current_user_can('manage_give_settings')) { |
|
72 | 72 | echo '<div class="error">'; |
73 | - echo '<p>' . esc_html__( 'Your site appears to be blocking the WordPress ajax interface. This may cause issues with Give.', 'give' ) . '</p>'; |
|
73 | + echo '<p>'.esc_html__('Your site appears to be blocking the WordPress ajax interface. This may cause issues with Give.', 'give').'</p>'; |
|
74 | 74 | /* translators: %s: https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/ */ |
75 | - echo '<p>' . sprintf( __( 'Please see <a href="%s" target="_blank">this reference</a> for possible solutions.', 'give' ), esc_url( 'https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/' ) ) . '</p>'; |
|
76 | - echo '<p><a href="' . add_query_arg( array( |
|
75 | + echo '<p>'.sprintf(__('Please see <a href="%s" target="_blank">this reference</a> for possible solutions.', 'give'), esc_url('https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/')).'</p>'; |
|
76 | + echo '<p><a href="'.add_query_arg(array( |
|
77 | 77 | 'give_action' => 'dismiss_notices', |
78 | 78 | 'give_notice' => 'admin_ajax_inaccessible' |
79 | - ) ) . '">' . esc_attr__( 'Dismiss Notice', 'give' ) . '</a></p>'; |
|
79 | + )).'">'.esc_attr__('Dismiss Notice', 'give').'</a></p>'; |
|
80 | 80 | echo '</div>'; |
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | - if ( isset( $_GET['give-message'] ) ) { |
|
84 | + if (isset($_GET['give-message'])) { |
|
85 | 85 | |
86 | 86 | // Donation reports errors. |
87 | - if ( current_user_can( 'view_give_reports' ) ) { |
|
88 | - switch ( $_GET['give-message'] ) { |
|
87 | + if (current_user_can('view_give_reports')) { |
|
88 | + switch ($_GET['give-message']) { |
|
89 | 89 | case 'payment_deleted' : |
90 | - $notices['updated']['give-payment-deleted'] = esc_attr__( 'The donation has been deleted.', 'give' ); |
|
90 | + $notices['updated']['give-payment-deleted'] = esc_attr__('The donation has been deleted.', 'give'); |
|
91 | 91 | break; |
92 | 92 | case 'email_sent' : |
93 | - $notices['updated']['give-payment-sent'] = esc_attr__( 'The donation receipt has been resent.', 'give' ); |
|
93 | + $notices['updated']['give-payment-sent'] = esc_attr__('The donation receipt has been resent.', 'give'); |
|
94 | 94 | break; |
95 | 95 | case 'refreshed-reports' : |
96 | - $notices['updated']['give-refreshed-reports'] = esc_attr__( 'The reports cache has been cleared.', 'give' ); |
|
96 | + $notices['updated']['give-refreshed-reports'] = esc_attr__('The reports cache has been cleared.', 'give'); |
|
97 | 97 | break; |
98 | 98 | case 'payment-note-deleted' : |
99 | - $notices['updated']['give-payment-note-deleted'] = esc_attr__( 'The donation note has been deleted.', 'give' ); |
|
99 | + $notices['updated']['give-payment-note-deleted'] = esc_attr__('The donation note has been deleted.', 'give'); |
|
100 | 100 | break; |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | 104 | // Give settings notices and errors. |
105 | - if ( current_user_can( 'manage_give_settings' ) ) { |
|
106 | - switch ( $_GET['give-message'] ) { |
|
105 | + if (current_user_can('manage_give_settings')) { |
|
106 | + switch ($_GET['give-message']) { |
|
107 | 107 | case 'settings-imported' : |
108 | - $notices['updated']['give-settings-imported'] = esc_attr__( 'The settings have been imported.', 'give' ); |
|
108 | + $notices['updated']['give-settings-imported'] = esc_attr__('The settings have been imported.', 'give'); |
|
109 | 109 | break; |
110 | 110 | case 'api-key-generated' : |
111 | - $notices['updated']['give-api-key-generated'] = esc_attr__( 'API keys have been generated.', 'give' ); |
|
111 | + $notices['updated']['give-api-key-generated'] = esc_attr__('API keys have been generated.', 'give'); |
|
112 | 112 | break; |
113 | 113 | case 'api-key-exists' : |
114 | - $notices['error']['give-api-key-exists'] = esc_attr__( 'The specified user already has API keys.', 'give' ); |
|
114 | + $notices['error']['give-api-key-exists'] = esc_attr__('The specified user already has API keys.', 'give'); |
|
115 | 115 | break; |
116 | 116 | case 'api-key-regenerated' : |
117 | - $notices['updated']['give-api-key-regenerated'] = esc_attr__( 'API keys have been regenerated.', 'give' ); |
|
117 | + $notices['updated']['give-api-key-regenerated'] = esc_attr__('API keys have been regenerated.', 'give'); |
|
118 | 118 | break; |
119 | 119 | case 'api-key-revoked' : |
120 | - $notices['updated']['give-api-key-revoked'] = esc_attr__( 'API keys have been revoked.', 'give' ); |
|
120 | + $notices['updated']['give-api-key-revoked'] = esc_attr__('API keys have been revoked.', 'give'); |
|
121 | 121 | break; |
122 | 122 | case 'sent-test-email' : |
123 | - $notices['updated']['give-sent-test-email'] = esc_attr__( 'The test email has been sent.', 'give' ); |
|
123 | + $notices['updated']['give-sent-test-email'] = esc_attr__('The test email has been sent.', 'give'); |
|
124 | 124 | break; |
125 | 125 | } |
126 | 126 | } |
127 | 127 | // Payments errors. |
128 | - if ( current_user_can( 'edit_give_payments' ) ) { |
|
129 | - switch ( $_GET['give-message'] ) { |
|
128 | + if (current_user_can('edit_give_payments')) { |
|
129 | + switch ($_GET['give-message']) { |
|
130 | 130 | case 'note-added' : |
131 | - $notices['updated']['give-note-added'] = esc_attr__( 'The donation note has been added.', 'give' ); |
|
131 | + $notices['updated']['give-note-added'] = esc_attr__('The donation note has been added.', 'give'); |
|
132 | 132 | break; |
133 | 133 | case 'payment-updated' : |
134 | - $notices['updated']['give-payment-updated'] = esc_attr__( 'The donation has been updated.', 'give' ); |
|
134 | + $notices['updated']['give-payment-updated'] = esc_attr__('The donation has been updated.', 'give'); |
|
135 | 135 | break; |
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
139 | 139 | // Customer Notices. |
140 | - if ( current_user_can( 'edit_give_payments' ) ) { |
|
141 | - switch ( $_GET['give-message'] ) { |
|
140 | + if (current_user_can('edit_give_payments')) { |
|
141 | + switch ($_GET['give-message']) { |
|
142 | 142 | case 'customer-deleted' : |
143 | - $notices['updated']['give-customer-deleted'] = esc_attr__( 'The donor has been deleted.', 'give' ); |
|
143 | + $notices['updated']['give-customer-deleted'] = esc_attr__('The donor has been deleted.', 'give'); |
|
144 | 144 | break; |
145 | 145 | |
146 | 146 | case 'email-added' : |
147 | - $notices['updated']['give-customer-email-added'] = __( 'Donor email added', 'give' ); |
|
147 | + $notices['updated']['give-customer-email-added'] = __('Donor email added', 'give'); |
|
148 | 148 | break; |
149 | 149 | |
150 | 150 | case 'email-removed' : |
151 | - $notices['updated']['give-customer-email-removed'] = __( 'Donor email removed', 'give'); |
|
151 | + $notices['updated']['give-customer-email-removed'] = __('Donor email removed', 'give'); |
|
152 | 152 | break; |
153 | 153 | |
154 | 154 | case 'email-remove-failed' : |
155 | - $notices['error']['give-customer-email-remove-failed'] = __( 'Failed to remove donor email', 'give'); |
|
155 | + $notices['error']['give-customer-email-remove-failed'] = __('Failed to remove donor email', 'give'); |
|
156 | 156 | break; |
157 | 157 | |
158 | 158 | case 'primary-email-updated' : |
159 | - $notices['updated']['give-customer-primary-email-updated'] = __( 'Primary email updated for donors', 'give'); |
|
159 | + $notices['updated']['give-customer-primary-email-updated'] = __('Primary email updated for donors', 'give'); |
|
160 | 160 | break; |
161 | 161 | |
162 | 162 | case 'primary-email-failed' : |
163 | - $notices['error']['give-customer-primary-email-failed'] = __( 'Failed to set primary email', 'give'); |
|
163 | + $notices['error']['give-customer-primary-email-failed'] = __('Failed to set primary email', 'give'); |
|
164 | 164 | |
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
168 | 168 | } |
169 | 169 | |
170 | - if ( count( $notices['updated'] ) > 0 ) { |
|
171 | - foreach ( $notices['updated'] as $notice => $message ) { |
|
172 | - add_settings_error( 'give-notices', $notice, $message, 'updated' ); |
|
170 | + if (count($notices['updated']) > 0) { |
|
171 | + foreach ($notices['updated'] as $notice => $message) { |
|
172 | + add_settings_error('give-notices', $notice, $message, 'updated'); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | - if ( count( $notices['error'] ) > 0 ) { |
|
177 | - foreach ( $notices['error'] as $notice => $message ) { |
|
178 | - add_settings_error( 'give-notices', $notice, $message, 'error' ); |
|
176 | + if (count($notices['error']) > 0) { |
|
177 | + foreach ($notices['error'] as $notice => $message) { |
|
178 | + add_settings_error('give-notices', $notice, $message, 'error'); |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | |
182 | - settings_errors( 'give-notices' ); |
|
182 | + settings_errors('give-notices'); |
|
183 | 183 | |
184 | 184 | } |
185 | 185 | |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | * @return void |
192 | 192 | */ |
193 | 193 | function give_admin_addons_notices() { |
194 | - add_settings_error( 'give-notices', 'give-addons-feed-error', esc_attr__( 'There seems to be an issue with the server. Please try again in a few minutes.', 'give' ), 'error' ); |
|
195 | - settings_errors( 'give-notices' ); |
|
194 | + add_settings_error('give-notices', 'give-addons-feed-error', esc_attr__('There seems to be an issue with the server. Please try again in a few minutes.', 'give'), 'error'); |
|
195 | + settings_errors('give-notices'); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | * @return void |
204 | 204 | */ |
205 | 205 | function dismiss_notices() { |
206 | - if ( isset( $_GET['give_notice'] ) ) { |
|
207 | - update_user_meta( get_current_user_id(), '_give_' . $_GET['give_notice'] . '_dismissed', 1 ); |
|
208 | - wp_redirect( remove_query_arg( array( 'give_action', 'give_notice' ) ) ); |
|
206 | + if (isset($_GET['give_notice'])) { |
|
207 | + update_user_meta(get_current_user_id(), '_give_'.$_GET['give_notice'].'_dismissed', 1); |
|
208 | + wp_redirect(remove_query_arg(array('give_action', 'give_notice'))); |
|
209 | 209 | exit; |
210 | 210 | } |
211 | 211 | } |
@@ -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 | |
@@ -27,34 +27,34 @@ discard block |
||
27 | 27 | * @return array $form_columns Updated array of forms columns |
28 | 28 | * Post Type List Table |
29 | 29 | */ |
30 | -function give_form_columns( $give_form_columns ) { |
|
30 | +function give_form_columns($give_form_columns) { |
|
31 | 31 | |
32 | 32 | //Standard columns |
33 | 33 | $give_form_columns = array( |
34 | 34 | 'cb' => '<input type="checkbox"/>', |
35 | - 'title' => esc_html__( 'Name', 'give' ), |
|
36 | - 'form_category' => esc_html__( 'Categories', 'give' ), |
|
37 | - 'form_tag' => esc_html__( 'Tags', 'give' ), |
|
38 | - 'price' => esc_html__( 'Price', 'give' ), |
|
39 | - 'goal' => esc_html__( 'Goal', 'give' ), |
|
40 | - 'donations' => esc_html__( 'Donations', 'give' ), |
|
41 | - 'earnings' => esc_html__( 'Income', 'give' ), |
|
42 | - 'shortcode' => esc_html__( 'Shortcode', 'give' ), |
|
43 | - 'date' => esc_html__( 'Date', 'give' ) |
|
35 | + 'title' => esc_html__('Name', 'give'), |
|
36 | + 'form_category' => esc_html__('Categories', 'give'), |
|
37 | + 'form_tag' => esc_html__('Tags', 'give'), |
|
38 | + 'price' => esc_html__('Price', 'give'), |
|
39 | + 'goal' => esc_html__('Goal', 'give'), |
|
40 | + 'donations' => esc_html__('Donations', 'give'), |
|
41 | + 'earnings' => esc_html__('Income', 'give'), |
|
42 | + 'shortcode' => esc_html__('Shortcode', 'give'), |
|
43 | + 'date' => esc_html__('Date', 'give') |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | //Does the user want categories / tags? |
47 | - if ( give_get_option( 'enable_categories' ) !== 'on' ) { |
|
48 | - unset( $give_form_columns['form_category'] ); |
|
47 | + if (give_get_option('enable_categories') !== 'on') { |
|
48 | + unset($give_form_columns['form_category']); |
|
49 | 49 | } |
50 | - if ( give_get_option( 'enable_tags' ) !== 'on' ) { |
|
51 | - unset( $give_form_columns['form_tag'] ); |
|
50 | + if (give_get_option('enable_tags') !== 'on') { |
|
51 | + unset($give_form_columns['form_tag']); |
|
52 | 52 | } |
53 | 53 | |
54 | - return apply_filters( 'give_forms_columns', $give_form_columns ); |
|
54 | + return apply_filters('give_forms_columns', $give_form_columns); |
|
55 | 55 | } |
56 | 56 | |
57 | -add_filter( 'manage_edit-give_forms_columns', 'give_form_columns' ); |
|
57 | +add_filter('manage_edit-give_forms_columns', 'give_form_columns'); |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Render Give Form Columns |
@@ -66,60 +66,60 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return void |
68 | 68 | */ |
69 | -function give_render_form_columns( $column_name, $post_id ) { |
|
70 | - if ( get_post_type( $post_id ) == 'give_forms' ) { |
|
69 | +function give_render_form_columns($column_name, $post_id) { |
|
70 | + if (get_post_type($post_id) == 'give_forms') { |
|
71 | 71 | |
72 | - switch ( $column_name ) { |
|
72 | + switch ($column_name) { |
|
73 | 73 | case 'form_category': |
74 | - echo get_the_term_list( $post_id, 'give_forms_category', '', ', ', '' ); |
|
74 | + echo get_the_term_list($post_id, 'give_forms_category', '', ', ', ''); |
|
75 | 75 | break; |
76 | 76 | case 'form_tag': |
77 | - echo get_the_term_list( $post_id, 'give_forms_tag', '', ', ', '' ); |
|
77 | + echo get_the_term_list($post_id, 'give_forms_tag', '', ', ', ''); |
|
78 | 78 | break; |
79 | 79 | case 'price': |
80 | - if ( give_has_variable_prices( $post_id ) ) { |
|
81 | - echo give_price_range( $post_id ); |
|
80 | + if (give_has_variable_prices($post_id)) { |
|
81 | + echo give_price_range($post_id); |
|
82 | 82 | } else { |
83 | - echo give_price( $post_id, false ); |
|
84 | - echo '<input type="hidden" class="formprice-' . $post_id . '" value="' . give_get_form_price( $post_id ) . '" />'; |
|
83 | + echo give_price($post_id, false); |
|
84 | + echo '<input type="hidden" class="formprice-'.$post_id.'" value="'.give_get_form_price($post_id).'" />'; |
|
85 | 85 | } |
86 | 86 | break; |
87 | 87 | case 'goal': |
88 | - $goal_option = get_post_meta( $post_id, '_give_goal_option', true ); |
|
89 | - if ( ! empty( $goal_option ) && $goal_option === 'yes' ) { |
|
90 | - echo give_goal( $post_id, false ); |
|
88 | + $goal_option = get_post_meta($post_id, '_give_goal_option', true); |
|
89 | + if ( ! empty($goal_option) && $goal_option === 'yes') { |
|
90 | + echo give_goal($post_id, false); |
|
91 | 91 | } else { |
92 | - esc_html_e( 'No Goal Set', 'give' ); |
|
92 | + esc_html_e('No Goal Set', 'give'); |
|
93 | 93 | } |
94 | 94 | |
95 | - echo '<input type="hidden" class="formgoal-' . $post_id . '" value="' . give_get_form_goal( $post_id ) . '" />'; |
|
95 | + echo '<input type="hidden" class="formgoal-'.$post_id.'" value="'.give_get_form_goal($post_id).'" />'; |
|
96 | 96 | break; |
97 | 97 | case 'donations': |
98 | - if ( current_user_can( 'view_give_form_stats', $post_id ) ) { |
|
99 | - echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=logs&view=sales&form=' . $post_id ) ) . '">'; |
|
100 | - echo give_get_form_sales_stats( $post_id ); |
|
98 | + if (current_user_can('view_give_form_stats', $post_id)) { |
|
99 | + echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&tab=logs&view=sales&form='.$post_id)).'">'; |
|
100 | + echo give_get_form_sales_stats($post_id); |
|
101 | 101 | echo '</a>'; |
102 | 102 | } else { |
103 | 103 | echo '-'; |
104 | 104 | } |
105 | 105 | break; |
106 | 106 | case 'earnings': |
107 | - if ( current_user_can( 'view_give_form_stats', $post_id ) ) { |
|
108 | - echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=forms&form-id=' . $post_id ) ) . '">'; |
|
109 | - echo give_currency_filter( give_format_amount( give_get_form_earnings_stats( $post_id ) ) ); |
|
107 | + if (current_user_can('view_give_form_stats', $post_id)) { |
|
108 | + echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&view=forms&form-id='.$post_id)).'">'; |
|
109 | + echo give_currency_filter(give_format_amount(give_get_form_earnings_stats($post_id))); |
|
110 | 110 | echo '</a>'; |
111 | 111 | } else { |
112 | 112 | echo '-'; |
113 | 113 | } |
114 | 114 | break; |
115 | 115 | case 'shortcode': |
116 | - echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id="' . absint( $post_id ) . '"]">'; |
|
116 | + echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id="'.absint($post_id).'"]">'; |
|
117 | 117 | break; |
118 | 118 | } |
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
122 | -add_action( 'manage_posts_custom_column', 'give_render_form_columns', 10, 2 ); |
|
122 | +add_action('manage_posts_custom_column', 'give_render_form_columns', 10, 2); |
|
123 | 123 | |
124 | 124 | /** |
125 | 125 | * Registers the sortable columns in the list table |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @return array $columns Array of sortable columns |
132 | 132 | */ |
133 | -function give_sortable_form_columns( $columns ) { |
|
133 | +function give_sortable_form_columns($columns) { |
|
134 | 134 | $columns['price'] = 'price'; |
135 | 135 | $columns['sales'] = 'sales'; |
136 | 136 | $columns['earnings'] = 'earnings'; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | return $columns; |
140 | 140 | } |
141 | 141 | |
142 | -add_filter( 'manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns' ); |
|
142 | +add_filter('manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns'); |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Sorts Columns in the Forms List Table |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return array $vars Array of all the sort variables |
152 | 152 | */ |
153 | -function give_sort_forms( $vars ) { |
|
153 | +function give_sort_forms($vars) { |
|
154 | 154 | // Check if we're viewing the "give_forms" post type |
155 | - if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) { |
|
155 | + if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) { |
|
156 | 156 | // Check if 'orderby' is set to "sales" |
157 | - if ( isset( $vars['orderby'] ) && 'sales' == $vars['orderby'] ) { |
|
157 | + if (isset($vars['orderby']) && 'sales' == $vars['orderby']) { |
|
158 | 158 | $vars = array_merge( |
159 | 159 | $vars, |
160 | 160 | array( |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | // Check if "orderby" is set to "earnings" |
168 | - if ( isset( $vars['orderby'] ) && 'earnings' == $vars['orderby'] ) { |
|
168 | + if (isset($vars['orderby']) && 'earnings' == $vars['orderby']) { |
|
169 | 169 | $vars = array_merge( |
170 | 170 | $vars, |
171 | 171 | array( |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | // Check if "orderby" is set to "price" |
179 | - if ( isset( $vars['orderby'] ) && 'price' == $vars['orderby'] ) { |
|
179 | + if (isset($vars['orderby']) && 'price' == $vars['orderby']) { |
|
180 | 180 | $vars = array_merge( |
181 | 181 | $vars, |
182 | 182 | array( |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | // Check if "orderby" is set to "goal" |
190 | - if ( isset( $vars['orderby'] ) && 'goal' == $vars['orderby'] ) { |
|
190 | + if (isset($vars['orderby']) && 'goal' == $vars['orderby']) { |
|
191 | 191 | $vars = array_merge( |
192 | 192 | $vars, |
193 | 193 | array( |
@@ -210,16 +210,16 @@ discard block |
||
210 | 210 | * |
211 | 211 | * @return array Array of all sort variables |
212 | 212 | */ |
213 | -function give_filter_forms( $vars ) { |
|
214 | - if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) { |
|
213 | +function give_filter_forms($vars) { |
|
214 | + if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) { |
|
215 | 215 | |
216 | 216 | // If an author ID was passed, use it |
217 | - if ( isset( $_REQUEST['author'] ) && ! current_user_can( 'view_give_reports' ) ) { |
|
217 | + if (isset($_REQUEST['author']) && ! current_user_can('view_give_reports')) { |
|
218 | 218 | |
219 | 219 | $author_id = $_REQUEST['author']; |
220 | - if ( (int) $author_id !== get_current_user_id() ) { |
|
220 | + if ((int) $author_id !== get_current_user_id()) { |
|
221 | 221 | // Tried to view the products of another person, sorry |
222 | - wp_die( esc_html__( 'You do not have permission to view this data.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
222 | + wp_die(esc_html__('You do not have permission to view this data.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
223 | 223 | } |
224 | 224 | $vars = array_merge( |
225 | 225 | $vars, |
@@ -244,11 +244,11 @@ discard block |
||
244 | 244 | * @return void |
245 | 245 | */ |
246 | 246 | function give_forms_load() { |
247 | - add_filter( 'request', 'give_sort_forms' ); |
|
248 | - add_filter( 'request', 'give_filter_forms' ); |
|
247 | + add_filter('request', 'give_sort_forms'); |
|
248 | + add_filter('request', 'give_filter_forms'); |
|
249 | 249 | } |
250 | 250 | |
251 | -add_action( 'load-edit.php', 'give_forms_load', 9999 ); |
|
251 | +add_action('load-edit.php', 'give_forms_load', 9999); |
|
252 | 252 | |
253 | 253 | /** |
254 | 254 | * Remove Forms Month Filter |
@@ -262,17 +262,17 @@ discard block |
||
262 | 262 | * @global $typenow The post type we are viewing |
263 | 263 | * @return array Empty array disables the dropdown |
264 | 264 | */ |
265 | -function give_remove_month_filter( $dates ) { |
|
265 | +function give_remove_month_filter($dates) { |
|
266 | 266 | global $typenow; |
267 | 267 | |
268 | - if ( $typenow == 'give_forms' ) { |
|
268 | + if ($typenow == 'give_forms') { |
|
269 | 269 | $dates = array(); |
270 | 270 | } |
271 | 271 | |
272 | 272 | return $dates; |
273 | 273 | } |
274 | 274 | |
275 | -add_filter( 'months_dropdown_results', 'give_remove_month_filter', 99 ); |
|
275 | +add_filter('months_dropdown_results', 'give_remove_month_filter', 99); |
|
276 | 276 | |
277 | 277 | /** |
278 | 278 | * Adds price field to Quick Edit options |
@@ -284,16 +284,16 @@ discard block |
||
284 | 284 | * |
285 | 285 | * @return void |
286 | 286 | */ |
287 | -function give_price_field_quick_edit( $column_name, $post_type ) { |
|
288 | - if ( $column_name != 'price' || $post_type != 'give_forms' ) { |
|
287 | +function give_price_field_quick_edit($column_name, $post_type) { |
|
288 | + if ($column_name != 'price' || $post_type != 'give_forms') { |
|
289 | 289 | return; |
290 | 290 | } |
291 | 291 | ?> |
292 | 292 | <fieldset class="inline-edit-col-left"> |
293 | 293 | <div id="give-give-data" class="inline-edit-col"> |
294 | - <h4><?php esc_html_e( 'Form Configuration', 'give' ); ?></h4> |
|
294 | + <h4><?php esc_html_e('Form Configuration', 'give'); ?></h4> |
|
295 | 295 | <label for="give_regprice"> |
296 | - <span class="title"><?php esc_html_e( 'Price', 'give' ); ?></span> |
|
296 | + <span class="title"><?php esc_html_e('Price', 'give'); ?></span> |
|
297 | 297 | <span class="input-text-wrap"> |
298 | 298 | <input type="text" name="give_regprice" id="give_regprice" class="text regprice" /> |
299 | 299 | </span> |
@@ -304,8 +304,8 @@ discard block |
||
304 | 304 | <?php |
305 | 305 | } |
306 | 306 | |
307 | -add_action( 'quick_edit_custom_box', 'give_price_field_quick_edit', 10, 2 ); |
|
308 | -add_action( 'bulk_edit_custom_box', 'give_price_field_quick_edit', 10, 2 ); |
|
307 | +add_action('quick_edit_custom_box', 'give_price_field_quick_edit', 10, 2); |
|
308 | +add_action('bulk_edit_custom_box', 'give_price_field_quick_edit', 10, 2); |
|
309 | 309 | |
310 | 310 | /** |
311 | 311 | * Updates price when saving post |
@@ -316,23 +316,23 @@ discard block |
||
316 | 316 | * |
317 | 317 | * @return void |
318 | 318 | */ |
319 | -function give_price_save_quick_edit( $post_id ) { |
|
320 | - if ( ! isset( $_POST['post_type'] ) || 'give_forms' !== $_POST['post_type'] ) { |
|
319 | +function give_price_save_quick_edit($post_id) { |
|
320 | + if ( ! isset($_POST['post_type']) || 'give_forms' !== $_POST['post_type']) { |
|
321 | 321 | return; |
322 | 322 | } |
323 | - if ( ! current_user_can( 'edit_post', $post_id ) ) { |
|
323 | + if ( ! current_user_can('edit_post', $post_id)) { |
|
324 | 324 | return $post_id; |
325 | 325 | } |
326 | - if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { |
|
326 | + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { |
|
327 | 327 | return $post_id; |
328 | 328 | } |
329 | 329 | |
330 | - if ( isset( $_REQUEST['_give_regprice'] ) ) { |
|
331 | - update_post_meta( $post_id, '_give_set_price', strip_tags( stripslashes( $_REQUEST['_give_regprice'] ) ) ); |
|
330 | + if (isset($_REQUEST['_give_regprice'])) { |
|
331 | + update_post_meta($post_id, '_give_set_price', strip_tags(stripslashes($_REQUEST['_give_regprice']))); |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | |
335 | -add_action( 'save_post', 'give_price_save_quick_edit' ); |
|
335 | +add_action('save_post', 'give_price_save_quick_edit'); |
|
336 | 336 | |
337 | 337 | /** |
338 | 338 | * Process bulk edit actions via AJAX |
@@ -342,18 +342,18 @@ discard block |
||
342 | 342 | */ |
343 | 343 | function give_save_bulk_edit() { |
344 | 344 | |
345 | - $post_ids = ( isset( $_POST['post_ids'] ) && ! empty( $_POST['post_ids'] ) ) ? $_POST['post_ids'] : array(); |
|
345 | + $post_ids = (isset($_POST['post_ids']) && ! empty($_POST['post_ids'])) ? $_POST['post_ids'] : array(); |
|
346 | 346 | |
347 | - if ( ! empty( $post_ids ) && is_array( $post_ids ) ) { |
|
348 | - $price = isset( $_POST['price'] ) ? strip_tags( stripslashes( $_POST['price'] ) ) : 0; |
|
349 | - foreach ( $post_ids as $post_id ) { |
|
347 | + if ( ! empty($post_ids) && is_array($post_ids)) { |
|
348 | + $price = isset($_POST['price']) ? strip_tags(stripslashes($_POST['price'])) : 0; |
|
349 | + foreach ($post_ids as $post_id) { |
|
350 | 350 | |
351 | - if ( ! current_user_can( 'edit_post', $post_id ) ) { |
|
351 | + if ( ! current_user_can('edit_post', $post_id)) { |
|
352 | 352 | continue; |
353 | 353 | } |
354 | 354 | |
355 | - if ( ! empty( $price ) ) { |
|
356 | - update_post_meta( $post_id, '_give_set_price', give_sanitize_amount( $price ) ); |
|
355 | + if ( ! empty($price)) { |
|
356 | + update_post_meta($post_id, '_give_set_price', give_sanitize_amount($price)); |
|
357 | 357 | } |
358 | 358 | } |
359 | 359 | } |
@@ -361,4 +361,4 @@ discard block |
||
361 | 361 | die(); |
362 | 362 | } |
363 | 363 | |
364 | -add_action( 'wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit' ); |
|
364 | +add_action('wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit'); |
@@ -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 --> |
@@ -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,12 +21,12 @@ discard block |
||
21 | 21 | * @return void |
22 | 22 | */ |
23 | 23 | function give_register_dashboard_widgets() { |
24 | - if ( current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) { |
|
25 | - wp_add_dashboard_widget( 'give_dashboard_sales', esc_html__( 'Give: Donation Statistics', 'give' ), 'give_dashboard_sales_widget' ); |
|
24 | + if (current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) { |
|
25 | + wp_add_dashboard_widget('give_dashboard_sales', esc_html__('Give: Donation Statistics', 'give'), 'give_dashboard_sales_widget'); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | -add_action( 'wp_dashboard_setup', 'give_register_dashboard_widgets', 10 ); |
|
29 | +add_action('wp_dashboard_setup', 'give_register_dashboard_widgets', 10); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Sales Summary Dashboard Widget |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | function give_dashboard_sales_widget() { |
40 | 40 | |
41 | - if ( ! current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) { |
|
41 | + if ( ! current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | $stats = new Give_Payment_Stats; ?> |
@@ -46,27 +46,27 @@ discard block |
||
46 | 46 | <div class="give-dashboard-widget"> |
47 | 47 | |
48 | 48 | <div class="give-dashboard-today give-clearfix"> |
49 | - <h3 class="give-dashboard-date-today"><?php echo date( _x( 'F j, Y', 'dashboard widget', 'give' ) ); ?></h3> |
|
49 | + <h3 class="give-dashboard-date-today"><?php echo date(_x('F j, Y', 'dashboard widget', 'give')); ?></h3> |
|
50 | 50 | |
51 | 51 | <p class="give-dashboard-happy-day"><?php |
52 | 52 | printf( |
53 | 53 | /* translators: %s: day of the week */ |
54 | - esc_html__( 'Happy %s!', 'give' ), |
|
55 | - date( 'l', current_time( 'timestamp' ) ) |
|
54 | + esc_html__('Happy %s!', 'give'), |
|
55 | + date('l', current_time('timestamp')) |
|
56 | 56 | ); |
57 | 57 | ?></p> |
58 | 58 | |
59 | 59 | <p class="give-dashboard-today-earnings"><?php |
60 | - $earnings_today = $stats->get_earnings( 0, 'today', false ); |
|
61 | - echo give_currency_filter( give_format_amount( $earnings_today ) ); |
|
60 | + $earnings_today = $stats->get_earnings(0, 'today', false); |
|
61 | + echo give_currency_filter(give_format_amount($earnings_today)); |
|
62 | 62 | ?></p> |
63 | 63 | |
64 | 64 | <p class="give-orders-today"><?php |
65 | - $donations_today = $stats->get_sales( 0, 'today', false ); |
|
65 | + $donations_today = $stats->get_sales(0, 'today', false); |
|
66 | 66 | printf( |
67 | 67 | /* translators: %s: daily donation count */ |
68 | - esc_html__( '%s donations today', 'give' ), |
|
69 | - give_format_amount( $donations_today, false ) |
|
68 | + esc_html__('%s donations today', 'give'), |
|
69 | + give_format_amount($donations_today, false) |
|
70 | 70 | ); |
71 | 71 | ?></p> |
72 | 72 | |
@@ -76,34 +76,34 @@ discard block |
||
76 | 76 | <table class="give-table-stats"> |
77 | 77 | <thead style="display: none;"> |
78 | 78 | <tr> |
79 | - <th><?php esc_html_e( 'This Week', 'give' ); ?></th> |
|
80 | - <th><?php esc_html_e( 'This Month', 'give' ); ?></th> |
|
81 | - <th><?php esc_html_e( 'Past 30 Days', 'give' ); ?></th> |
|
79 | + <th><?php esc_html_e('This Week', 'give'); ?></th> |
|
80 | + <th><?php esc_html_e('This Month', 'give'); ?></th> |
|
81 | + <th><?php esc_html_e('Past 30 Days', 'give'); ?></th> |
|
82 | 82 | </tr> |
83 | 83 | </thead> |
84 | 84 | <tbody> |
85 | 85 | <tr id="give-table-stats-tr-1"> |
86 | 86 | <td> |
87 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_week' ) ) ); ?></p> |
|
87 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'))); ?></p> |
|
88 | 88 | |
89 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Week', 'give' ); ?></p> |
|
89 | + <p class="give-dashboard-stat-total-label"><?php esc_html_e('This Week', 'give'); ?></p> |
|
90 | 90 | </td> |
91 | 91 | <td> |
92 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_month' ) ) ); ?></p> |
|
92 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'))); ?></p> |
|
93 | 93 | |
94 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Month', 'give' ); ?></p> |
|
94 | + <p class="give-dashboard-stat-total-label"><?php esc_html_e('This Month', 'give'); ?></p> |
|
95 | 95 | </td> |
96 | 96 | </tr> |
97 | 97 | <tr id="give-table-stats-tr-2"> |
98 | 98 | <td> |
99 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'last_month' ) ) ) ?></p> |
|
99 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'))) ?></p> |
|
100 | 100 | |
101 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'Last Month', 'give' ); ?></p> |
|
101 | + <p class="give-dashboard-stat-total-label"><?php esc_html_e('Last Month', 'give'); ?></p> |
|
102 | 102 | </td> |
103 | 103 | <td> |
104 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_year', false ) ) ) ?></p> |
|
104 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_year', false))) ?></p> |
|
105 | 105 | |
106 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Year', 'give' ); ?></p> |
|
106 | + <p class="give-dashboard-stat-total-label"><?php esc_html_e('This Year', 'give'); ?></p> |
|
107 | 107 | </td> |
108 | 108 | </tr> |
109 | 109 | </tbody> |
@@ -123,23 +123,23 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return array |
125 | 125 | */ |
126 | -function give_dashboard_at_a_glance_widget( $items ) { |
|
127 | - $num_posts = wp_count_posts( 'give_forms' ); |
|
126 | +function give_dashboard_at_a_glance_widget($items) { |
|
127 | + $num_posts = wp_count_posts('give_forms'); |
|
128 | 128 | |
129 | - if ( $num_posts && $num_posts->publish ) { |
|
129 | + if ($num_posts && $num_posts->publish) { |
|
130 | 130 | |
131 | 131 | $text = sprintf( |
132 | 132 | /* translators: %s: number of posts published */ |
133 | - _n( '%s Give Form', '%s Give Forms', $num_posts->publish, 'give' ), |
|
133 | + _n('%s Give Form', '%s Give Forms', $num_posts->publish, 'give'), |
|
134 | 134 | $num_posts->publish |
135 | 135 | ); |
136 | 136 | |
137 | - $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); |
|
137 | + $text = sprintf($text, number_format_i18n($num_posts->publish)); |
|
138 | 138 | |
139 | - if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) { |
|
140 | - $text = sprintf( '<a class="give-forms-count" href="edit.php?post_type=give_forms">%1$s</a>', $text ); |
|
139 | + if (current_user_can('edit_give_forms', get_current_user_id())) { |
|
140 | + $text = sprintf('<a class="give-forms-count" href="edit.php?post_type=give_forms">%1$s</a>', $text); |
|
141 | 141 | } else { |
142 | - $text = sprintf( '<span class="give-forms-count">%1$s</span>', $text ); |
|
142 | + $text = sprintf('<span class="give-forms-count">%1$s</span>', $text); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | $items[] = $text; |
@@ -148,4 +148,4 @@ discard block |
||
148 | 148 | return $items; |
149 | 149 | } |
150 | 150 | |
151 | -add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1 ); |
|
151 | +add_filter('dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @since 1.0 |
36 | 36 | */ |
37 | 37 | public function __construct() { |
38 | - add_action( 'admin_menu', array( $this, 'admin_menus' ) ); |
|
39 | - add_action( 'admin_head', array( $this, 'admin_head' ) ); |
|
40 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
38 | + add_action('admin_menu', array($this, 'admin_menus')); |
|
39 | + add_action('admin_head', array($this, 'admin_head')); |
|
40 | + add_action('admin_init', array($this, 'welcome')); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -49,45 +49,45 @@ discard block |
||
49 | 49 | * @return void |
50 | 50 | */ |
51 | 51 | public function admin_menus() { |
52 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
52 | + list($display_version) = explode('-', GIVE_VERSION); |
|
53 | 53 | |
54 | 54 | // About Page |
55 | 55 | add_dashboard_page( |
56 | 56 | /* translators: %s: Give version */ |
57 | - sprintf( esc_html__( 'Welcome to Give %s', 'give' ), $display_version ), |
|
58 | - esc_html__( 'Welcome to Give', 'give' ), |
|
57 | + sprintf(esc_html__('Welcome to Give %s', 'give'), $display_version), |
|
58 | + esc_html__('Welcome to Give', 'give'), |
|
59 | 59 | $this->minimum_capability, |
60 | 60 | 'give-about', |
61 | - array( $this, 'about_screen' ) |
|
61 | + array($this, 'about_screen') |
|
62 | 62 | ); |
63 | 63 | |
64 | 64 | // Changelog Page |
65 | 65 | add_dashboard_page( |
66 | - esc_html__( 'Give Changelog', 'give' ), |
|
67 | - esc_html__( 'Give Changelog', 'give' ), |
|
66 | + esc_html__('Give Changelog', 'give'), |
|
67 | + esc_html__('Give Changelog', 'give'), |
|
68 | 68 | $this->minimum_capability, |
69 | 69 | 'give-changelog', |
70 | - array( $this, 'changelog_screen' ) |
|
70 | + array($this, 'changelog_screen') |
|
71 | 71 | ); |
72 | 72 | |
73 | 73 | // Getting Started Page |
74 | 74 | add_dashboard_page( |
75 | 75 | /* translators: %s: Give version */ |
76 | - sprintf( esc_html__( 'Give %s - Getting Started Guide', 'give' ), $display_version ), |
|
77 | - esc_html__( 'Getting started with Give', 'give' ), |
|
76 | + sprintf(esc_html__('Give %s - Getting Started Guide', 'give'), $display_version), |
|
77 | + esc_html__('Getting started with Give', 'give'), |
|
78 | 78 | $this->minimum_capability, |
79 | 79 | 'give-getting-started', |
80 | - array( $this, 'getting_started_screen' ) |
|
80 | + array($this, 'getting_started_screen') |
|
81 | 81 | ); |
82 | 82 | |
83 | 83 | // Credits Page |
84 | 84 | add_dashboard_page( |
85 | 85 | /* translators: %s: Give version */ |
86 | - sprintf( esc_html__( 'Give %s - Credits', 'give' ), $display_version ), |
|
87 | - esc_html__( 'The people that build Give', 'give' ), |
|
86 | + sprintf(esc_html__('Give %s - Credits', 'give'), $display_version), |
|
87 | + esc_html__('The people that build Give', 'give'), |
|
88 | 88 | $this->minimum_capability, |
89 | 89 | 'give-credits', |
90 | - array( $this, 'credits_screen' ) |
|
90 | + array($this, 'credits_screen') |
|
91 | 91 | ); |
92 | 92 | } |
93 | 93 | |
@@ -100,13 +100,13 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function admin_head() { |
102 | 102 | |
103 | - remove_submenu_page( 'index.php', 'give-about' ); |
|
104 | - remove_submenu_page( 'index.php', 'give-changelog' ); |
|
105 | - remove_submenu_page( 'index.php', 'give-getting-started' ); |
|
106 | - remove_submenu_page( 'index.php', 'give-credits' ); |
|
103 | + remove_submenu_page('index.php', 'give-about'); |
|
104 | + remove_submenu_page('index.php', 'give-changelog'); |
|
105 | + remove_submenu_page('index.php', 'give-getting-started'); |
|
106 | + remove_submenu_page('index.php', 'give-credits'); |
|
107 | 107 | |
108 | 108 | // Badge for welcome page |
109 | - $badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png'; |
|
109 | + $badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png'; |
|
110 | 110 | |
111 | 111 | ?> |
112 | 112 | <style type="text/css" media="screen"> |
@@ -186,20 +186,20 @@ discard block |
||
186 | 186 | * @return void |
187 | 187 | */ |
188 | 188 | public function tabs() { |
189 | - $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about'; |
|
189 | + $selected = isset($_GET['page']) ? $_GET['page'] : 'give-about'; |
|
190 | 190 | ?> |
191 | 191 | <h2 class="nav-tab-wrapper"> |
192 | - <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>"> |
|
193 | - <?php esc_html_e( 'About Give', 'give' ); ?> |
|
192 | + <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>"> |
|
193 | + <?php esc_html_e('About Give', 'give'); ?> |
|
194 | 194 | </a> |
195 | - <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>"> |
|
196 | - <?php esc_html_e( 'Getting Started', 'give' ); ?> |
|
195 | + <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>"> |
|
196 | + <?php esc_html_e('Getting Started', 'give'); ?> |
|
197 | 197 | </a> |
198 | - <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>"> |
|
199 | - <?php esc_html_e( 'Credits', 'give' ); ?> |
|
198 | + <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>"> |
|
199 | + <?php esc_html_e('Credits', 'give'); ?> |
|
200 | 200 | </a> |
201 | - <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
202 | - <?php esc_html_e( 'Add-ons', 'give' ); ?> |
|
201 | + <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
202 | + <?php esc_html_e('Add-ons', 'give'); ?> |
|
203 | 203 | </a> |
204 | 204 | </h2> |
205 | 205 | <?php |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * @return void |
214 | 214 | */ |
215 | 215 | public function about_screen() { |
216 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
216 | + list($display_version) = explode('-', GIVE_VERSION); |
|
217 | 217 | ?> |
218 | 218 | <div class="wrap about-wrap"> |
219 | 219 | <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1> |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | <p class="about-text"><?php |
224 | 224 | printf( |
225 | 225 | /* translators: %s: https://givewp.com/documenation/ */ |
226 | - __( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ), |
|
227 | - esc_url( 'https://givewp.com/documenation/' ) |
|
226 | + __('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'), |
|
227 | + esc_url('https://givewp.com/documenation/') |
|
228 | 228 | ); |
229 | 229 | ?></p> |
230 | 230 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | <div class="give-badge"><?php |
234 | 234 | printf( |
235 | 235 | /* translators: %s: Give version */ |
236 | - esc_html__( 'Version %s', 'give' ), |
|
236 | + esc_html__('Version %s', 'give'), |
|
237 | 237 | $display_version |
238 | 238 | ); |
239 | 239 | ?></div> |
@@ -243,16 +243,16 @@ discard block |
||
243 | 243 | <div class="feature-section clearfix introduction"> |
244 | 244 | |
245 | 245 | <div class="video feature-section-item"> |
246 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>"> |
|
246 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" alt="<?php esc_attr_e('A Give donation form', 'give'); ?>"> |
|
247 | 247 | </div> |
248 | 248 | |
249 | 249 | <div class="content feature-section-item last-feature"> |
250 | 250 | |
251 | - <h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3> |
|
251 | + <h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3> |
|
252 | 252 | |
253 | - <p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p> |
|
253 | + <p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p> |
|
254 | 254 | <a href="https://givewp.com" target="_blank" class="button-secondary"> |
255 | - <?php esc_html_e( 'Learn More', 'give' ); ?> |
|
255 | + <?php esc_html_e('Learn More', 'give'); ?> |
|
256 | 256 | <span class="dashicons dashicons-external"></span> |
257 | 257 | </a> |
258 | 258 | |
@@ -265,11 +265,11 @@ discard block |
||
265 | 265 | |
266 | 266 | <div class="content feature-section-item"> |
267 | 267 | |
268 | - <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3> |
|
268 | + <h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3> |
|
269 | 269 | |
270 | - <p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p> |
|
270 | + <p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p> |
|
271 | 271 | <a href="https://givewp.com/documentation" target="_blank" class="button-secondary"> |
272 | - <?php esc_html_e( 'View Documentation', 'give' ); ?> |
|
272 | + <?php esc_html_e('View Documentation', 'give'); ?> |
|
273 | 273 | <span class="dashicons dashicons-external"></span> |
274 | 274 | </a> |
275 | 275 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | <div class="content feature-section-item last-feature"> |
279 | 279 | |
280 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" alt="<?php esc_attr_e( 'Give', 'give' ); ?>"> |
|
280 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" alt="<?php esc_attr_e('Give', 'give'); ?>"> |
|
281 | 281 | |
282 | 282 | </div> |
283 | 283 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @return void |
298 | 298 | */ |
299 | 299 | public function changelog_screen() { |
300 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
300 | + list($display_version) = explode('-', GIVE_VERSION); |
|
301 | 301 | ?> |
302 | 302 | <div class="wrap about-wrap"> |
303 | 303 | <h1><?php echo get_admin_page_title(); ?></h1> |
@@ -305,14 +305,14 @@ discard block |
||
305 | 305 | <p class="about-text"><?php |
306 | 306 | printf( |
307 | 307 | /* translators: %s: Give version */ |
308 | - esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ), |
|
308 | + esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'), |
|
309 | 309 | $display_version |
310 | 310 | ); |
311 | 311 | ?></p> |
312 | 312 | <div class="give-badge"><?php |
313 | 313 | printf( |
314 | 314 | /* translators: %s: Give version */ |
315 | - esc_html__( 'Version %s', 'give' ), |
|
315 | + esc_html__('Version %s', 'give'), |
|
316 | 316 | $display_version |
317 | 317 | ); |
318 | 318 | ?></div> |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | <?php $this->tabs(); ?> |
321 | 321 | |
322 | 322 | <div class="changelog"> |
323 | - <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3> |
|
323 | + <h3><?php esc_html_e('Full Changelog', 'give'); ?></h3> |
|
324 | 324 | |
325 | 325 | <div class="feature-section"> |
326 | 326 | <?php echo $this->parse_readme(); ?> |
@@ -328,10 +328,10 @@ discard block |
||
328 | 328 | </div> |
329 | 329 | |
330 | 330 | <div class="return-to-dashboard"> |
331 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( |
|
331 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array( |
|
332 | 332 | 'post_type' => 'give_forms', |
333 | 333 | 'page' => 'give-settings' |
334 | - ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a> |
|
334 | + ), 'edit.php'))); ?>"><?php esc_html_e('Give Settings', 'give'); ?></a> |
|
335 | 335 | </div> |
336 | 336 | </div> |
337 | 337 | <?php |
@@ -345,37 +345,37 @@ discard block |
||
345 | 345 | * @return void |
346 | 346 | */ |
347 | 347 | public function getting_started_screen() { |
348 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
348 | + list($display_version) = explode('-', GIVE_VERSION); |
|
349 | 349 | ?> |
350 | 350 | <div class="wrap about-wrap get-started"> |
351 | 351 | <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1> |
352 | 352 | |
353 | 353 | <?php give_social_media_elements() ?> |
354 | 354 | |
355 | - <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p> |
|
355 | + <p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p> |
|
356 | 356 | |
357 | 357 | <?php give_get_newsletter(); ?> |
358 | 358 | |
359 | 359 | <div class="give-badge"><?php |
360 | 360 | printf( |
361 | 361 | /* translators: %s: Give version */ |
362 | - esc_html__( 'Version %s', 'give' ), |
|
362 | + esc_html__('Version %s', 'give'), |
|
363 | 363 | $display_version |
364 | 364 | ); |
365 | 365 | ?></div> |
366 | 366 | |
367 | 367 | <?php $this->tabs(); ?> |
368 | 368 | |
369 | - <p class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p> |
|
369 | + <p class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></p> |
|
370 | 370 | |
371 | 371 | <div class="feature-section clearfix"> |
372 | 372 | |
373 | 373 | <div class="content feature-section-item"> |
374 | - <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3> |
|
374 | + <h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3> |
|
375 | 375 | |
376 | - <p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p> |
|
376 | + <p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p> |
|
377 | 377 | |
378 | - <p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add Form".', 'give' ); ?></p> |
|
378 | + <p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add Form".', 'give'); ?></p> |
|
379 | 379 | </div> |
380 | 380 | |
381 | 381 | <div class="content feature-section-item last-feature"> |
@@ -392,9 +392,9 @@ discard block |
||
392 | 392 | </div> |
393 | 393 | |
394 | 394 | <div class="content feature-section-item last-feature"> |
395 | - <h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3> |
|
395 | + <h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3> |
|
396 | 396 | |
397 | - <p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p> |
|
397 | + <p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p> |
|
398 | 398 | </div> |
399 | 399 | |
400 | 400 | </div> |
@@ -403,11 +403,11 @@ discard block |
||
403 | 403 | <div class="feature-section clearfix"> |
404 | 404 | |
405 | 405 | <div class="content feature-section-item add-content"> |
406 | - <h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3> |
|
406 | + <h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3> |
|
407 | 407 | |
408 | - <p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p> |
|
408 | + <p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p> |
|
409 | 409 | |
410 | - <p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p> |
|
410 | + <p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p> |
|
411 | 411 | </div> |
412 | 412 | |
413 | 413 | <div class="content feature-section-item last-feature"> |
@@ -424,9 +424,9 @@ discard block |
||
424 | 424 | </div> |
425 | 425 | |
426 | 426 | <div class="content feature-section-item last-feature"> |
427 | - <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3> |
|
427 | + <h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3> |
|
428 | 428 | |
429 | - <p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p> |
|
429 | + <p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p> |
|
430 | 430 | </div> |
431 | 431 | |
432 | 432 | |
@@ -446,23 +446,23 @@ discard block |
||
446 | 446 | * @return void |
447 | 447 | */ |
448 | 448 | public function credits_screen() { |
449 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
449 | + list($display_version) = explode('-', GIVE_VERSION); |
|
450 | 450 | ?> |
451 | 451 | <div class="wrap about-wrap"> |
452 | 452 | <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1> |
453 | 453 | |
454 | 454 | <?php give_social_media_elements() ?> |
455 | 455 | |
456 | - <p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p> |
|
456 | + <p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly.', 'give'); ?></p> |
|
457 | 457 | |
458 | - <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p> |
|
458 | + <p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p> |
|
459 | 459 | |
460 | 460 | <?php give_get_newsletter(); ?> |
461 | 461 | |
462 | 462 | <div class="give-badge"><?php |
463 | 463 | printf( |
464 | 464 | /* translators: %s: Give version */ |
465 | - esc_html__( 'Version %s', 'give' ), |
|
465 | + esc_html__('Version %s', 'give'), |
|
466 | 466 | $display_version |
467 | 467 | ); |
468 | 468 | ?></div> |
@@ -472,8 +472,8 @@ discard block |
||
472 | 472 | <p class="about-description"><?php |
473 | 473 | printf( |
474 | 474 | /* translators: %s: https://github.com/WordImpress/give */ |
475 | - __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), |
|
476 | - esc_url( 'https://github.com/WordImpress/give' ) |
|
475 | + __('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), |
|
476 | + esc_url('https://github.com/WordImpress/give') |
|
477 | 477 | ); |
478 | 478 | ?></p> |
479 | 479 | |
@@ -490,21 +490,21 @@ discard block |
||
490 | 490 | * @return string $readme HTML formatted readme file |
491 | 491 | */ |
492 | 492 | public function parse_readme() { |
493 | - $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
493 | + $file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null; |
|
494 | 494 | |
495 | - if ( ! $file ) { |
|
496 | - $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>'; |
|
495 | + if ( ! $file) { |
|
496 | + $readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>'; |
|
497 | 497 | } else { |
498 | - $readme = file_get_contents( $file ); |
|
499 | - $readme = nl2br( esc_html( $readme ) ); |
|
500 | - $readme = explode( '== Changelog ==', $readme ); |
|
501 | - $readme = end( $readme ); |
|
502 | - |
|
503 | - $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); |
|
504 | - $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); |
|
505 | - $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); |
|
506 | - $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); |
|
507 | - $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); |
|
498 | + $readme = file_get_contents($file); |
|
499 | + $readme = nl2br(esc_html($readme)); |
|
500 | + $readme = explode('== Changelog ==', $readme); |
|
501 | + $readme = end($readme); |
|
502 | + |
|
503 | + $readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme); |
|
504 | + $readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme); |
|
505 | + $readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme); |
|
506 | + $readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme); |
|
507 | + $readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | return $readme; |
@@ -521,24 +521,24 @@ discard block |
||
521 | 521 | public function contributors() { |
522 | 522 | $contributors = $this->get_contributors(); |
523 | 523 | |
524 | - if ( empty( $contributors ) ) { |
|
524 | + if (empty($contributors)) { |
|
525 | 525 | return ''; |
526 | 526 | } |
527 | 527 | |
528 | 528 | $contributor_list = '<ul class="wp-people-group">'; |
529 | 529 | |
530 | - foreach ( $contributors as $contributor ) { |
|
530 | + foreach ($contributors as $contributor) { |
|
531 | 531 | $contributor_list .= '<li class="wp-person">'; |
532 | 532 | $contributor_list .= sprintf( |
533 | 533 | '<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>', |
534 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
535 | - esc_url( $contributor->avatar_url ), |
|
536 | - esc_attr( $contributor->login ) |
|
534 | + esc_url('https://github.com/'.$contributor->login), |
|
535 | + esc_url($contributor->avatar_url), |
|
536 | + esc_attr($contributor->login) |
|
537 | 537 | ); |
538 | 538 | $contributor_list .= sprintf( |
539 | 539 | '<a class="web" target="_blank" href="%1$s">%2$s</a>', |
540 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
541 | - esc_html( $contributor->login ) |
|
540 | + esc_url('https://github.com/'.$contributor->login), |
|
541 | + esc_html($contributor->login) |
|
542 | 542 | ); |
543 | 543 | $contributor_list .= '</li>'; |
544 | 544 | } |
@@ -556,25 +556,25 @@ discard block |
||
556 | 556 | * @return array $contributors List of contributors |
557 | 557 | */ |
558 | 558 | public function get_contributors() { |
559 | - $contributors = get_transient( 'give_contributors' ); |
|
559 | + $contributors = get_transient('give_contributors'); |
|
560 | 560 | |
561 | - if ( false !== $contributors ) { |
|
561 | + if (false !== $contributors) { |
|
562 | 562 | return $contributors; |
563 | 563 | } |
564 | 564 | |
565 | - $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) ); |
|
565 | + $response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false)); |
|
566 | 566 | |
567 | - if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { |
|
567 | + if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) { |
|
568 | 568 | return array(); |
569 | 569 | } |
570 | 570 | |
571 | - $contributors = json_decode( wp_remote_retrieve_body( $response ) ); |
|
571 | + $contributors = json_decode(wp_remote_retrieve_body($response)); |
|
572 | 572 | |
573 | - if ( ! is_array( $contributors ) ) { |
|
573 | + if ( ! is_array($contributors)) { |
|
574 | 574 | return array(); |
575 | 575 | } |
576 | 576 | |
577 | - set_transient( 'give_contributors', $contributors, 3600 ); |
|
577 | + set_transient('give_contributors', $contributors, 3600); |
|
578 | 578 | |
579 | 579 | return $contributors; |
580 | 580 | } |
@@ -592,24 +592,24 @@ discard block |
||
592 | 592 | $give_options = give_get_settings(); |
593 | 593 | |
594 | 594 | // Bail if no activation redirect |
595 | - if ( ! get_transient( '_give_activation_redirect' ) ) { |
|
595 | + if ( ! get_transient('_give_activation_redirect')) { |
|
596 | 596 | return; |
597 | 597 | } |
598 | 598 | |
599 | 599 | // Delete the redirect transient |
600 | - delete_transient( '_give_activation_redirect' ); |
|
600 | + delete_transient('_give_activation_redirect'); |
|
601 | 601 | |
602 | 602 | // Bail if activating from network, or bulk |
603 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
603 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
604 | 604 | return; |
605 | 605 | } |
606 | 606 | |
607 | - $upgrade = get_option( 'give_version_upgraded_from' ); |
|
607 | + $upgrade = get_option('give_version_upgraded_from'); |
|
608 | 608 | |
609 | - if ( ! $upgrade ) { // First time install |
|
610 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
609 | + if ( ! $upgrade) { // First time install |
|
610 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
611 | 611 | exit; |
612 | - } elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings |
|
612 | + } elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings |
|
613 | 613 | |
614 | 614 | } else { // Welcome is NOT disabled in settings |
615 | 615 | wp_safe_redirect(admin_url('index.php?page=give-about')); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | // Exit if accessed directly |
11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
11 | +if ( ! defined('ABSPATH')) { |
|
12 | 12 | exit; |
13 | 13 | } |
14 | 14 | |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @param $_banner_details |
27 | 27 | */ |
28 | - function __construct( $_banner_details ) { |
|
28 | + function __construct($_banner_details) { |
|
29 | 29 | |
30 | 30 | $current_user = wp_get_current_user(); |
31 | 31 | |
32 | 32 | $this->banner_details = $_banner_details; |
33 | - $this->test_mode = ( $this->banner_details['testing'] == 'true' ) ? true : false; |
|
34 | - $this->nag_meta_key = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] ); |
|
33 | + $this->test_mode = ($this->banner_details['testing'] == 'true') ? true : false; |
|
34 | + $this->nag_meta_key = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']); |
|
35 | 35 | |
36 | 36 | //Get current user |
37 | 37 | $this->user_id = $current_user->ID; |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | public function init() { |
52 | 52 | |
53 | 53 | //Testing? |
54 | - if ( $this->test_mode ) { |
|
55 | - delete_user_meta( $this->user_id, $this->nag_meta_key ); |
|
54 | + if ($this->test_mode) { |
|
55 | + delete_user_meta($this->user_id, $this->nag_meta_key); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | //Get the current page to add the notice to |
59 | - add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) ); |
|
60 | - add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) ); |
|
59 | + add_action('current_screen', array($this, 'give_addon_notice_ignore')); |
|
60 | + add_action('admin_notices', array($this, 'give_addon_activation_admin_notice')); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | global $pagenow; |
73 | 73 | |
74 | 74 | //Make sure we're on the plugins page. |
75 | - if ( $pagenow !== 'plugins.php' ) { |
|
75 | + if ($pagenow !== 'plugins.php') { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
79 | 79 | // If the user hasn't already dismissed the alert, output activation banner. |
80 | - if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) { |
|
80 | + if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) { |
|
81 | 81 | |
82 | 82 | // Output inline styles here because there's no reason |
83 | 83 | // to enqueued them after the alert is dismissed. |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | <div class="updated give-addon-alert"> |
160 | 160 | |
161 | 161 | <!-- Dismiss Button --> |
162 | - <a href="<?php echo admin_url( 'plugins.php?' . $this->nag_meta_key . '=0' ); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a> |
|
162 | + <a href="<?php echo admin_url('plugins.php?'.$this->nag_meta_key.'=0'); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a> |
|
163 | 163 | |
164 | 164 | <!-- Logo --> |
165 | 165 | <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/images/svg/give-icon-full-circle.svg" class="give-logo" /> |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | <h3><?php |
171 | 171 | printf( |
172 | 172 | /* translators: %s: Add-on name */ |
173 | - esc_html__( "Thank you for installing Give's %s Add-on!", 'give' ), |
|
174 | - '<span>' . $this->banner_details['name'] . '</span>' |
|
173 | + esc_html__("Thank you for installing Give's %s Add-on!", 'give'), |
|
174 | + '<span>'.$this->banner_details['name'].'</span>' |
|
175 | 175 | ); |
176 | 176 | ?></h3> |
177 | 177 | |
@@ -180,23 +180,23 @@ discard block |
||
180 | 180 | |
181 | 181 | <?php |
182 | 182 | //Point them to your settings page |
183 | - if ( isset( $this->banner_details['settings_url'] ) ) { |
|
183 | + if (isset($this->banner_details['settings_url'])) { |
|
184 | 184 | ?> |
185 | 185 | <a href="<?php echo $this->banner_details['settings_url']; ?>"> |
186 | - <span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?> |
|
186 | + <span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?> |
|
187 | 187 | </a> |
188 | 188 | <?php |
189 | 189 | } |
190 | 190 | |
191 | 191 | // Show them how to configure the Addon |
192 | - if ( isset( $this->banner_details['documentation_url'] ) ) { |
|
192 | + if (isset($this->banner_details['documentation_url'])) { |
|
193 | 193 | ?> |
194 | 194 | <a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank"> |
195 | 195 | <span class="dashicons dashicons-media-text"></span> |
196 | 196 | <?php |
197 | 197 | printf( |
198 | 198 | /* translators: %s: Add-on name */ |
199 | - esc_html__( 'Documentation: %s Add-on', 'give' ), |
|
199 | + esc_html__('Documentation: %s Add-on', 'give'), |
|
200 | 200 | $this->banner_details['name'] |
201 | 201 | ); |
202 | 202 | ?> |
@@ -205,10 +205,10 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | //Let them signup for plugin updates |
208 | - if ( isset( $this->banner_details['support_url'] ) ) { |
|
208 | + if (isset($this->banner_details['support_url'])) { |
|
209 | 209 | ?> |
210 | 210 | <a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank"> |
211 | - <span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?> |
|
211 | + <span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?> |
|
212 | 212 | </a> |
213 | 213 | <?php |
214 | 214 | } |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | /* If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not. |
237 | 237 | * See here: http://codex.wordpress.org/Function_Reference/add_user_meta |
238 | 238 | */ |
239 | - if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) { |
|
239 | + if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) { |
|
240 | 240 | |
241 | 241 | //Get the global user |
242 | 242 | $current_user = wp_get_current_user(); |
243 | 243 | $user_id = $current_user->ID; |
244 | 244 | |
245 | - add_user_meta( $user_id, $this->nag_meta_key, 'true', true ); |
|
245 | + add_user_meta($user_id, $this->nag_meta_key, 'true', true); |
|
246 | 246 | } |
247 | 247 | } |
248 | 248 |
@@ -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 | |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return array An array of updated action links. |
25 | 25 | */ |
26 | -function give_plugin_action_links( $actions ) { |
|
26 | +function give_plugin_action_links($actions) { |
|
27 | 27 | $new_actions = array( |
28 | 28 | 'settings' => sprintf( |
29 | 29 | '<a href="%1$s">%2$s</a>', |
30 | - admin_url( 'edit.php?post_type=give_forms&page=give-settings' ), |
|
31 | - esc_html__( 'Settings', 'give' ) |
|
30 | + admin_url('edit.php?post_type=give_forms&page=give-settings'), |
|
31 | + esc_html__('Settings', 'give') |
|
32 | 32 | ), |
33 | 33 | ); |
34 | 34 | |
35 | - return array_merge( $new_actions, $actions ); |
|
35 | + return array_merge($new_actions, $actions); |
|
36 | 36 | } |
37 | 37 | |
38 | -add_filter( 'plugin_action_links_' . GIVE_PLUGIN_BASENAME, 'give_plugin_action_links' ); |
|
38 | +add_filter('plugin_action_links_'.GIVE_PLUGIN_BASENAME, 'give_plugin_action_links'); |
|
39 | 39 | |
40 | 40 | |
41 | 41 | /** |
@@ -48,35 +48,35 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return array |
50 | 50 | */ |
51 | -function give_plugin_row_meta( $plugin_meta, $plugin_file ) { |
|
52 | - if ( $plugin_file != GIVE_PLUGIN_BASENAME ) { |
|
51 | +function give_plugin_row_meta($plugin_meta, $plugin_file) { |
|
52 | + if ($plugin_file != GIVE_PLUGIN_BASENAME) { |
|
53 | 53 | return $plugin_meta; |
54 | 54 | } |
55 | 55 | |
56 | 56 | $new_meta_links = array( |
57 | 57 | sprintf( |
58 | 58 | '<a href="%1$s" target="_blank">%2$s</a>', |
59 | - esc_url( add_query_arg( array( |
|
59 | + esc_url(add_query_arg(array( |
|
60 | 60 | 'utm_source' => 'plugins-page', |
61 | 61 | 'utm_medium' => 'plugin-row', |
62 | 62 | 'utm_campaign' => 'admin', |
63 | - ), 'https://givewp.com/documentation/' ) |
|
63 | + ), 'https://givewp.com/documentation/') |
|
64 | 64 | ), |
65 | - esc_html__( 'Documentation', 'give' ) |
|
65 | + esc_html__('Documentation', 'give') |
|
66 | 66 | ), |
67 | 67 | sprintf( |
68 | 68 | '<a href="%1$s" target="_blank">%2$s</a>', |
69 | - esc_url( add_query_arg( array( |
|
69 | + esc_url(add_query_arg(array( |
|
70 | 70 | 'utm_source' => 'plugins-page', |
71 | 71 | 'utm_medium' => 'plugin-row', |
72 | 72 | 'utm_campaign' => 'admin', |
73 | - ), 'https://givewp.com/addons/' ) |
|
73 | + ), 'https://givewp.com/addons/') |
|
74 | 74 | ), |
75 | - esc_html__( 'Add-ons', 'give' ) |
|
75 | + esc_html__('Add-ons', 'give') |
|
76 | 76 | ), |
77 | 77 | ); |
78 | 78 | |
79 | - return array_merge( $plugin_meta, $new_meta_links ); |
|
79 | + return array_merge($plugin_meta, $new_meta_links); |
|
80 | 80 | } |
81 | 81 | |
82 | -add_filter( 'plugin_row_meta', 'give_plugin_row_meta', 10, 2 ); |
|
82 | +add_filter('plugin_row_meta', 'give_plugin_row_meta', 10, 2); |