@@ -259,8 +259,11 @@ discard block |
||
259 | 259 | <span class="customer-user-id info-item editable"> |
260 | 260 | <?php if ( intval( $customer->user_id ) > 0 ) : ?> |
261 | 261 | <span data-key="user_id"><?php echo $customer->user_id; ?></span> |
262 | - <?php else : ?> |
|
263 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> |
|
262 | + <?php else { |
|
263 | + : ?> |
|
264 | + <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); |
|
265 | +} |
|
266 | +?></span> |
|
264 | 267 | <?php endif; ?> |
265 | 268 | <?php if ( current_user_can( $customer_edit_role ) && intval( $customer->user_id ) > 0 ) : ?> |
266 | 269 | <span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" title="<?php esc_attr_e( 'Disconnects the current user ID from this customer record', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> |
@@ -329,8 +332,11 @@ discard block |
||
329 | 332 | } |
330 | 333 | ?> |
331 | 334 | </select> |
332 | - <?php else : ?> |
|
333 | - <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' ); ?>" /> |
|
335 | + <?php else { |
|
336 | + : ?> |
|
337 | + <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' ); |
|
338 | +} |
|
339 | +?>" /> |
|
334 | 340 | <?php endif; ?> |
335 | 341 | <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Postal', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
336 | 342 | </span> |
@@ -420,9 +426,12 @@ discard block |
||
420 | 426 | </td> |
421 | 427 | </tr> |
422 | 428 | <?php endforeach; ?> |
423 | - <?php else: ?> |
|
429 | + <?php else { |
|
430 | + : ?> |
|
424 | 431 | <tr> |
425 | - <td colspan="5"><?php esc_html_e( 'No Donations Found', 'give' ); ?></td> |
|
432 | + <td colspan="5"><?php esc_html_e( 'No Donations Found', 'give' ); |
|
433 | +} |
|
434 | +?></td> |
|
426 | 435 | </tr> |
427 | 436 | <?php endif; ?> |
428 | 437 | </tbody> |
@@ -463,9 +472,12 @@ discard block |
||
463 | 472 | </td> |
464 | 473 | </tr> |
465 | 474 | <?php endforeach; ?> |
466 | - <?php else: ?> |
|
475 | + <?php else { |
|
476 | + : ?> |
|
467 | 477 | <tr> |
468 | - <td colspan="2"><?php esc_html_e( 'No Completed Donations Found', 'give' ); ?></td> |
|
478 | + <td colspan="2"><?php esc_html_e( 'No Completed Donations Found', 'give' ); |
|
479 | +} |
|
480 | +?></td> |
|
469 | 481 | </tr> |
470 | 482 | <?php endif; ?> |
471 | 483 | </tbody> |
@@ -539,9 +551,12 @@ discard block |
||
539 | 551 | </span> |
540 | 552 | </div> |
541 | 553 | <?php endforeach; ?> |
542 | - <?php else: ?> |
|
554 | + <?php else { |
|
555 | + : ?> |
|
543 | 556 | <div class="give-no-customer-notes"> |
544 | - <?php esc_html_e( 'No Donor Notes', 'give' ); ?> |
|
557 | + <?php esc_html_e( 'No Donor Notes', 'give' ); |
|
558 | +} |
|
559 | +?> |
|
545 | 560 | </div> |
546 | 561 | <?php endif; ?> |
547 | 562 | </div> |
@@ -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,24 +67,24 @@ 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(); |
74 | 74 | ?> |
75 | 75 | <div class="wrap"> |
76 | - <h1><?php esc_html_e( 'Donors', 'give' ); ?></h1> |
|
76 | + <h1><?php esc_html_e('Donors', 'give'); ?></h1> |
|
77 | 77 | <?php |
78 | 78 | /** |
79 | 79 | * Fires in donors screen, above the table. |
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 Provided.', 'give' ) ); |
|
127 | + if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
128 | + give_set_error('give-invalid_customer', esc_html__('Invalid Donor ID Provided.', '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 Provided.', 'give' ) ); |
|
135 | + if (empty($customer->id)) { |
|
136 | + give_set_error('give-invalid_customer', esc_html__('Invalid Donor ID Provided.', 'give')); |
|
137 | 137 | $render = false; |
138 | 138 | } |
139 | 139 | |
@@ -142,27 +142,27 @@ 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 | - <?php if ( $customer && $render ) : ?> |
|
151 | + <?php if ($customer && $render) : ?> |
|
152 | 152 | |
153 | 153 | <div id="customer-tab-wrapper"> |
154 | 154 | <ul id="customer-tab-wrapper-list" class="nav-tab-wrapper"> |
155 | - <?php foreach ( $customer_tabs as $key => $tab ) : ?> |
|
155 | + <?php foreach ($customer_tabs as $key => $tab) : ?> |
|
156 | 156 | <?php $active = $key === $view ? true : false; ?> |
157 | 157 | <?php $class = $active ? 'active' : 'inactive'; ?> |
158 | 158 | |
159 | - <li class="<?php echo sanitize_html_class( $class ); ?>"> |
|
160 | - <?php if ( ! $active ) : ?> |
|
161 | - <a title="<?php esc_attr_e( $tab['title'] ); ?>" aria-label="<?php esc_attr_e( $tab['title'] ); ?>" href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $customer->id ) ); ?>"> |
|
159 | + <li class="<?php echo sanitize_html_class($class); ?>"> |
|
160 | + <?php if ( ! $active) : ?> |
|
161 | + <a title="<?php esc_attr_e($tab['title']); ?>" aria-label="<?php esc_attr_e($tab['title']); ?>" href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$customer->id)); ?>"> |
|
162 | 162 | <?php endif; ?> |
163 | 163 | |
164 | - <span class="dashicons <?php echo sanitize_html_class( $tab['dashicon'] ); ?>"></span> <?php esc_html_e( $tab['title'] ); ?> |
|
165 | - <?php if ( ! $active ) : ?> |
|
164 | + <span class="dashicons <?php echo sanitize_html_class($tab['dashicon']); ?>"></span> <?php esc_html_e($tab['title']); ?> |
|
165 | + <?php if ( ! $active) : ?> |
|
166 | 166 | </a> |
167 | 167 | <?php endif; ?> |
168 | 168 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | </div> |
175 | 175 | |
176 | 176 | <div id="give-customer-card-wrapper"> |
177 | - <?php $callbacks[ $view ]( $customer ) ?> |
|
177 | + <?php $callbacks[$view]($customer) ?> |
|
178 | 178 | </div> |
179 | 179 | |
180 | 180 | <?php endif; ?> |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | * |
195 | 195 | * @return void |
196 | 196 | */ |
197 | -function give_customers_view( $customer ) { |
|
197 | +function give_customers_view($customer) { |
|
198 | 198 | |
199 | - $customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' ); |
|
199 | + $customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments'); |
|
200 | 200 | |
201 | 201 | /** |
202 | 202 | * Fires in donor profile screen, above the donor card. |
@@ -205,32 +205,32 @@ discard block |
||
205 | 205 | * |
206 | 206 | * @param object $customer The customer object being displayed. |
207 | 207 | */ |
208 | - do_action( 'give_donor_card_top', $customer ); |
|
208 | + do_action('give_donor_card_top', $customer); |
|
209 | 209 | ?> |
210 | 210 | |
211 | 211 | <div id="donor-summary" class="info-wrapper customer-section postbox"> |
212 | 212 | |
213 | - <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 ); ?>"> |
|
213 | + <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); ?>"> |
|
214 | 214 | |
215 | 215 | <div class="customer-info"> |
216 | 216 | |
217 | 217 | <div class="donor-bio-header clearfix"> |
218 | 218 | |
219 | 219 | <div class="avatar-wrap left" id="customer-avatar"> |
220 | - <?php echo get_avatar( $customer->email ); ?> |
|
220 | + <?php echo get_avatar($customer->email); ?> |
|
221 | 221 | </div> |
222 | 222 | |
223 | 223 | <div id="customer-name-wrap" class="left"> |
224 | 224 | <span class="customer-id">#<?php echo $customer->id; ?></span> |
225 | - <span class="customer-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php esc_attr_e( $customer->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span> |
|
225 | + <span class="customer-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php esc_attr_e($customer->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span> |
|
226 | 226 | <span class="customer-name info-item editable"><span data-key="name"><?php echo $customer->name; ?></span></span> |
227 | 227 | </div> |
228 | 228 | <p class="customer-since info-item"> |
229 | - <?php esc_html_e( 'Donor since', 'give' ); ?> |
|
230 | - <?php echo date_i18n( get_option( 'date_format' ), strtotime( $customer->date_created ) ) ?> |
|
229 | + <?php esc_html_e('Donor since', 'give'); ?> |
|
230 | + <?php echo date_i18n(get_option('date_format'), strtotime($customer->date_created)) ?> |
|
231 | 231 | </p> |
232 | - <?php if ( current_user_can( $customer_edit_role ) ): ?> |
|
233 | - <a title="<?php esc_attr_e( 'Edit Donor', 'give' ); ?>" href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a> |
|
232 | + <?php if (current_user_can($customer_edit_role)): ?> |
|
233 | + <a title="<?php esc_attr_e('Edit Donor', 'give'); ?>" href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a> |
|
234 | 234 | <?php endif; ?> |
235 | 235 | </div> |
236 | 236 | <!-- /donor-bio-header --> |
@@ -240,14 +240,14 @@ discard block |
||
240 | 240 | <table class="widefat"> |
241 | 241 | <tbody> |
242 | 242 | <tr> |
243 | - <td><label for="tablecell"><?php esc_html_e( 'Email', 'give' ); ?></label>:</td> |
|
243 | + <td><label for="tablecell"><?php esc_html_e('Email', 'give'); ?></label>:</td> |
|
244 | 244 | <td class="row-title"> |
245 | - <span class="customer-name info-item edit-item"><input size="20" data-key="email" name="customerinfo[email]" type="text" value="<?php echo $customer->email; ?>" placeholder="<?php esc_attr_e( 'Donor Email', 'give' ); ?>" /></span> |
|
245 | + <span class="customer-name info-item edit-item"><input size="20" data-key="email" name="customerinfo[email]" type="text" value="<?php echo $customer->email; ?>" placeholder="<?php esc_attr_e('Donor Email', 'give'); ?>" /></span> |
|
246 | 246 | <span class="customer-email info-item editable" data-key="email"><?php echo $customer->email; ?></span> |
247 | 247 | </td> |
248 | 248 | </tr> |
249 | 249 | <tr class="alternate"> |
250 | - <td><label for="tablecell"><?php esc_html_e( 'User ID', 'give' ); ?></label>:</td> |
|
250 | + <td><label for="tablecell"><?php esc_html_e('User ID', 'give'); ?></label>:</td> |
|
251 | 251 | <td class="row-title"> |
252 | 252 | <span class="customer-user-id info-item edit-item"> |
253 | 253 | <?php |
@@ -263,38 +263,38 @@ discard block |
||
263 | 263 | 'data' => $data_atts, |
264 | 264 | ); |
265 | 265 | |
266 | - if ( ! empty( $user_id ) ) { |
|
267 | - $userdata = get_userdata( $user_id ); |
|
266 | + if ( ! empty($user_id)) { |
|
267 | + $userdata = get_userdata($user_id); |
|
268 | 268 | $user_args['value'] = $userdata->user_login; |
269 | 269 | } |
270 | 270 | |
271 | - echo Give()->html->ajax_user_search( $user_args ); |
|
271 | + echo Give()->html->ajax_user_search($user_args); |
|
272 | 272 | ?> |
273 | 273 | <input type="hidden" name="customerinfo[user_id]" data-key="user_id" value="<?php echo $customer->user_id; ?>" /> |
274 | 274 | </span> |
275 | 275 | |
276 | 276 | <span class="customer-user-id info-item editable"> |
277 | - <?php if ( intval( $customer->user_id ) > 0 ) : ?> |
|
277 | + <?php if (intval($customer->user_id) > 0) : ?> |
|
278 | 278 | <span data-key="user_id"><?php echo $customer->user_id; ?></span> |
279 | 279 | <?php else : ?> |
280 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> |
|
280 | + <span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span> |
|
281 | 281 | <?php endif; ?> |
282 | - <?php if ( current_user_can( $customer_edit_role ) && intval( $customer->user_id ) > 0 ) : ?> |
|
283 | - <span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" title="<?php esc_attr_e( 'Disconnects the current user ID from this customer record', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> |
|
282 | + <?php if (current_user_can($customer_edit_role) && intval($customer->user_id) > 0) : ?> |
|
283 | + <span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" title="<?php esc_attr_e('Disconnects the current user ID from this customer record', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span> |
|
284 | 284 | <?php endif; ?> |
285 | 285 | </span> |
286 | 286 | </td> |
287 | 287 | </tr> |
288 | - <?php if ( isset( $customer->user_id ) && $customer->user_id > 0 ) : ?> |
|
288 | + <?php if (isset($customer->user_id) && $customer->user_id > 0) : ?> |
|
289 | 289 | |
290 | 290 | <tr> |
291 | - <td><?php esc_html_e( 'Address', 'give' ); ?>:</td> |
|
291 | + <td><?php esc_html_e('Address', 'give'); ?>:</td> |
|
292 | 292 | <td class="row-title"> |
293 | 293 | |
294 | 294 | <div class="customer-address-wrapper"> |
295 | 295 | |
296 | 296 | <?php |
297 | - $address = get_user_meta( $customer->user_id, '_give_user_address', true ); |
|
297 | + $address = get_user_meta($customer->user_id, '_give_user_address', true); |
|
298 | 298 | $defaults = array( |
299 | 299 | 'line1' => '', |
300 | 300 | 'line2' => '', |
@@ -304,10 +304,10 @@ discard block |
||
304 | 304 | 'zip' => '' |
305 | 305 | ); |
306 | 306 | |
307 | - $address = wp_parse_args( $address, $defaults ); |
|
307 | + $address = wp_parse_args($address, $defaults); |
|
308 | 308 | ?> |
309 | 309 | |
310 | - <?php if ( ! empty( $address ) ) { ?> |
|
310 | + <?php if ( ! empty($address)) { ?> |
|
311 | 311 | <span class="customer-address info-item editable"> |
312 | 312 | <span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span> |
313 | 313 | <span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span> |
@@ -318,38 +318,38 @@ discard block |
||
318 | 318 | </span> |
319 | 319 | <?php } ?> |
320 | 320 | <span class="customer-address info-item edit-item"> |
321 | - <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']; ?>" /> |
|
322 | - <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']; ?>" /> |
|
323 | - <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" /> |
|
321 | + <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']; ?>" /> |
|
322 | + <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']; ?>" /> |
|
323 | + <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" /> |
|
324 | 324 | <select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item"> |
325 | 325 | <?php |
326 | 326 | |
327 | 327 | $selected_country = $address['country']; |
328 | 328 | |
329 | 329 | $countries = give_get_country_list(); |
330 | - foreach ( $countries as $country_code => $country ) { |
|
331 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
330 | + foreach ($countries as $country_code => $country) { |
|
331 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
332 | 332 | } |
333 | 333 | ?> |
334 | 334 | </select> |
335 | 335 | <?php |
336 | 336 | $selected_state = give_get_state(); |
337 | - $states = give_get_states( $selected_country ); |
|
337 | + $states = give_get_states($selected_country); |
|
338 | 338 | |
339 | - $selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state; |
|
339 | + $selected_state = isset($address['state']) ? $address['state'] : $selected_state; |
|
340 | 340 | |
341 | - if ( ! empty( $states ) ) : ?> |
|
341 | + if ( ! empty($states)) : ?> |
|
342 | 342 | <select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item"> |
343 | 343 | <?php |
344 | - foreach ( $states as $state_code => $state ) { |
|
345 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
344 | + foreach ($states as $state_code => $state) { |
|
345 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
346 | 346 | } |
347 | 347 | ?> |
348 | 348 | </select> |
349 | 349 | <?php else : ?> |
350 | - <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' ); ?>" /> |
|
350 | + <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'); ?>" /> |
|
351 | 351 | <?php endif; ?> |
352 | - <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Postal', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
|
352 | + <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Postal', 'give'); ?>" value="<?php echo $address['zip']; ?>" /> |
|
353 | 353 | </span> |
354 | 354 | |
355 | 355 | </div> |
@@ -366,10 +366,10 @@ discard block |
||
366 | 366 | |
367 | 367 | <span id="customer-edit-actions" class="edit-item"> |
368 | 368 | <input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $customer->id; ?>" /> |
369 | - <?php wp_nonce_field( 'edit-customer', '_wpnonce', false, true ); ?> |
|
369 | + <?php wp_nonce_field('edit-customer', '_wpnonce', false, true); ?> |
|
370 | 370 | <input type="hidden" name="give_action" value="edit-customer" /> |
371 | - <input type="submit" id="give-edit-customer-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" /> |
|
372 | - <a id="give-edit-customer-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
371 | + <input type="submit" id="give-edit-customer-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" /> |
|
372 | + <a id="give-edit-customer-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
373 | 373 | </span> |
374 | 374 | |
375 | 375 | </form> |
@@ -384,24 +384,24 @@ discard block |
||
384 | 384 | * |
385 | 385 | * @param object $customer The customer object being displayed. |
386 | 386 | */ |
387 | - do_action( 'give_donor_before_stats', $customer ); |
|
387 | + do_action('give_donor_before_stats', $customer); |
|
388 | 388 | ?> |
389 | 389 | |
390 | 390 | <div id="customer-stats-wrapper" class="customer-section postbox clear"> |
391 | 391 | <ul> |
392 | 392 | <li> |
393 | - <a title="<?php esc_attr_e( 'View All Donations', 'give' ); ?>" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $customer->email ) ); ?>"> |
|
393 | + <a title="<?php esc_attr_e('View All Donations', 'give'); ?>" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($customer->email)); ?>"> |
|
394 | 394 | <span class="dashicons dashicons-heart"></span> |
395 | 395 | <?php |
396 | 396 | //Completed Donations |
397 | - $completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $customer->purchase_count, 'give' ), $customer->purchase_count ); |
|
398 | - echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $customer ); |
|
397 | + $completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $customer->purchase_count, 'give'), $customer->purchase_count); |
|
398 | + echo apply_filters('give_donor_completed_donations', $completed_donations_text, $customer); |
|
399 | 399 | ?> |
400 | 400 | </a> |
401 | 401 | </li> |
402 | 402 | <li> |
403 | 403 | <span class="dashicons dashicons-chart-area"></span> |
404 | - <?php echo give_currency_filter( give_format_amount( $customer->purchase_value ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?> |
|
404 | + <?php echo give_currency_filter(give_format_amount($customer->purchase_value)); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?> |
|
405 | 405 | </li> |
406 | 406 | <?php |
407 | 407 | /** |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * |
414 | 414 | * @param object $customer The customer object being displayed. |
415 | 415 | */ |
416 | - do_action( 'give_donor_stats_list', $customer ); |
|
416 | + do_action('give_donor_stats_list', $customer); |
|
417 | 417 | ?> |
418 | 418 | </ul> |
419 | 419 | </div> |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | * |
427 | 427 | * @param object $customer The customer object being displayed. |
428 | 428 | */ |
429 | - do_action( 'give_donor_before_tables_wrapper', $customer ); |
|
429 | + do_action('give_donor_before_tables_wrapper', $customer); |
|
430 | 430 | ?> |
431 | 431 | |
432 | 432 | <div id="customer-tables-wrapper" class="customer-section"> |
@@ -439,37 +439,37 @@ discard block |
||
439 | 439 | * |
440 | 440 | * @param object $customer The customer object being displayed. |
441 | 441 | */ |
442 | - do_action( 'give_donor_before_tables', $customer ); |
|
442 | + do_action('give_donor_before_tables', $customer); |
|
443 | 443 | ?> |
444 | 444 | |
445 | - <h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3> |
|
445 | + <h3><?php esc_html_e('Recent Donations', 'give'); ?></h3> |
|
446 | 446 | <?php |
447 | - $payment_ids = explode( ',', $customer->payment_ids ); |
|
448 | - $payments = give_get_payments( array( 'post__in' => $payment_ids ) ); |
|
449 | - $payments = array_slice( $payments, 0, 10 ); |
|
447 | + $payment_ids = explode(',', $customer->payment_ids); |
|
448 | + $payments = give_get_payments(array('post__in' => $payment_ids)); |
|
449 | + $payments = array_slice($payments, 0, 10); |
|
450 | 450 | ?> |
451 | 451 | <table class="wp-list-table widefat striped payments"> |
452 | 452 | <thead> |
453 | 453 | <tr> |
454 | - <th><?php esc_html_e( 'ID', 'give' ); ?></th> |
|
455 | - <th><?php esc_html_e( 'Amount', 'give' ); ?></th> |
|
456 | - <th><?php esc_html_e( 'Date', 'give' ); ?></th> |
|
457 | - <th><?php esc_html_e( 'Status', 'give' ); ?></th> |
|
458 | - <th><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
454 | + <th><?php esc_html_e('ID', 'give'); ?></th> |
|
455 | + <th><?php esc_html_e('Amount', 'give'); ?></th> |
|
456 | + <th><?php esc_html_e('Date', 'give'); ?></th> |
|
457 | + <th><?php esc_html_e('Status', 'give'); ?></th> |
|
458 | + <th><?php esc_html_e('Actions', 'give'); ?></th> |
|
459 | 459 | </tr> |
460 | 460 | </thead> |
461 | 461 | <tbody> |
462 | - <?php if ( ! empty( $payments ) ) : ?> |
|
463 | - <?php foreach ( $payments as $payment ) : ?> |
|
462 | + <?php if ( ! empty($payments)) : ?> |
|
463 | + <?php foreach ($payments as $payment) : ?> |
|
464 | 464 | <tr> |
465 | 465 | <td><?php echo $payment->ID; ?></td> |
466 | - <td><?php echo give_payment_amount( $payment->ID ); ?></td> |
|
467 | - <td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $payment->post_date ) ); ?></td> |
|
468 | - <td><?php echo give_get_payment_status( $payment, true ); ?></td> |
|
466 | + <td><?php echo give_payment_amount($payment->ID); ?></td> |
|
467 | + <td><?php echo date_i18n(get_option('date_format'), strtotime($payment->post_date)); ?></td> |
|
468 | + <td><?php echo give_get_payment_status($payment, true); ?></td> |
|
469 | 469 | <td> |
470 | - <a title="<?php esc_attr_e( 'View Details for Donation', 'give' ); |
|
471 | - echo ' ' . $payment->ID; ?>" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment->ID ); ?>"> |
|
472 | - <?php esc_html_e( 'View Details', 'give' ); ?> |
|
470 | + <a title="<?php esc_attr_e('View Details for Donation', 'give'); |
|
471 | + echo ' '.$payment->ID; ?>" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$payment->ID); ?>"> |
|
472 | + <?php esc_html_e('View Details', 'give'); ?> |
|
473 | 473 | </a> |
474 | 474 | <?php |
475 | 475 | /** |
@@ -482,47 +482,47 @@ discard block |
||
482 | 482 | * @param object $customer The customer object being displayed. |
483 | 483 | * @param object $payment The payment object being displayed. |
484 | 484 | */ |
485 | - do_action( 'give_donor_recent_purchases_actions', $customer, $payment ); |
|
485 | + do_action('give_donor_recent_purchases_actions', $customer, $payment); |
|
486 | 486 | ?> |
487 | 487 | </td> |
488 | 488 | </tr> |
489 | 489 | <?php endforeach; ?> |
490 | 490 | <?php else: ?> |
491 | 491 | <tr> |
492 | - <td colspan="5"><?php esc_html_e( 'No Donations Found', 'give' ); ?></td> |
|
492 | + <td colspan="5"><?php esc_html_e('No Donations Found', 'give'); ?></td> |
|
493 | 493 | </tr> |
494 | 494 | <?php endif; ?> |
495 | 495 | </tbody> |
496 | 496 | </table> |
497 | 497 | |
498 | - <h3><?php esc_html_e( 'Completed Donations', 'give' ); ?></h3> |
|
498 | + <h3><?php esc_html_e('Completed Donations', 'give'); ?></h3> |
|
499 | 499 | <?php |
500 | - $donations = give_get_users_completed_donations( $customer->email ); |
|
500 | + $donations = give_get_users_completed_donations($customer->email); |
|
501 | 501 | ?> |
502 | 502 | <table class="wp-list-table widefat striped donations"> |
503 | 503 | <thead> |
504 | 504 | <tr> |
505 | 505 | <th><?php echo give_get_forms_label_singular(); ?></th> |
506 | - <th width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
506 | + <th width="120px"><?php esc_html_e('Actions', 'give'); ?></th> |
|
507 | 507 | </tr> |
508 | 508 | </thead> |
509 | 509 | <tbody> |
510 | - <?php if ( ! empty( $donations ) ) : ?> |
|
511 | - <?php foreach ( $donations as $donation ) : ?> |
|
510 | + <?php if ( ! empty($donations)) : ?> |
|
511 | + <?php foreach ($donations as $donation) : ?> |
|
512 | 512 | <tr> |
513 | 513 | <td><?php echo $donation->post_title; ?></td> |
514 | 514 | <td> |
515 | 515 | <a title="<?php |
516 | 516 | printf( |
517 | 517 | /* translators: %s: post title */ |
518 | - esc_attr__( 'View %s', 'give' ), |
|
518 | + esc_attr__('View %s', 'give'), |
|
519 | 519 | $donation->post_title |
520 | - ); ?>" href="<?php echo esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ); |
|
520 | + ); ?>" href="<?php echo esc_url(admin_url('post.php?action=edit&post='.$donation->ID)); |
|
521 | 521 | ?>"> |
522 | 522 | <?php |
523 | 523 | printf( |
524 | 524 | /* translators: %s: forms singular label */ |
525 | - esc_html__( 'View %s', 'give' ), |
|
525 | + esc_html__('View %s', 'give'), |
|
526 | 526 | give_get_forms_label_singular() |
527 | 527 | ); |
528 | 528 | ?> |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | <?php endforeach; ?> |
533 | 533 | <?php else: ?> |
534 | 534 | <tr> |
535 | - <td colspan="2"><?php esc_html_e( 'No Completed Donations Found', 'give' ); ?></td> |
|
535 | + <td colspan="2"><?php esc_html_e('No Completed Donations Found', 'give'); ?></td> |
|
536 | 536 | </tr> |
537 | 537 | <?php endif; ?> |
538 | 538 | </tbody> |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | * |
547 | 547 | * @param object $customer The customer object being displayed. |
548 | 548 | */ |
549 | - do_action( 'give_donor_after_tables', $customer ); |
|
549 | + do_action('give_donor_after_tables', $customer); |
|
550 | 550 | ?> |
551 | 551 | |
552 | 552 | </div> |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | * |
560 | 560 | * @param object $customer The customer object being displayed. |
561 | 561 | */ |
562 | - do_action( 'give_donor_card_bottom', $customer ); |
|
562 | + do_action('give_donor_card_bottom', $customer); |
|
563 | 563 | |
564 | 564 | } |
565 | 565 | |
@@ -572,30 +572,30 @@ discard block |
||
572 | 572 | * |
573 | 573 | * @return void |
574 | 574 | */ |
575 | -function give_customer_notes_view( $customer ) { |
|
575 | +function give_customer_notes_view($customer) { |
|
576 | 576 | |
577 | - $paged = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1; |
|
578 | - $paged = absint( $paged ); |
|
577 | + $paged = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1; |
|
578 | + $paged = absint($paged); |
|
579 | 579 | $note_count = $customer->get_notes_count(); |
580 | - $per_page = apply_filters( 'give_customer_notes_per_page', 20 ); |
|
581 | - $total_pages = ceil( $note_count / $per_page ); |
|
582 | - $customer_notes = $customer->get_notes( $per_page, $paged ); |
|
580 | + $per_page = apply_filters('give_customer_notes_per_page', 20); |
|
581 | + $total_pages = ceil($note_count / $per_page); |
|
582 | + $customer_notes = $customer->get_notes($per_page, $paged); |
|
583 | 583 | ?> |
584 | 584 | |
585 | 585 | <div id="customer-notes-wrapper"> |
586 | 586 | <div class="customer-notes-header"> |
587 | - <?php echo get_avatar( $customer->email, 30 ); ?> <span><?php echo $customer->name; ?></span> |
|
587 | + <?php echo get_avatar($customer->email, 30); ?> <span><?php echo $customer->name; ?></span> |
|
588 | 588 | </div> |
589 | - <h3><?php esc_html_e( 'Notes', 'give' ); ?></h3> |
|
589 | + <h3><?php esc_html_e('Notes', 'give'); ?></h3> |
|
590 | 590 | |
591 | - <?php if ( 1 == $paged ) : ?> |
|
591 | + <?php if (1 == $paged) : ?> |
|
592 | 592 | <div style="display: block; margin-bottom: 55px;"> |
593 | - <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 ); ?>"> |
|
593 | + <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); ?>"> |
|
594 | 594 | <textarea id="customer-note" name="customer_note" class="customer-note-input" rows="10"></textarea> |
595 | 595 | <br /> |
596 | 596 | <input type="hidden" id="customer-id" name="customer_id" value="<?php echo $customer->id; ?>" /> |
597 | 597 | <input type="hidden" name="give_action" value="add-customer-note" /> |
598 | - <?php wp_nonce_field( 'add-customer-note', 'add_customer_note_nonce', true, true ); ?> |
|
598 | + <?php wp_nonce_field('add-customer-note', 'add_customer_note_nonce', true, true); ?> |
|
599 | 599 | <input id="add-customer-note" class="right button-primary" type="submit" value="Add Note" /> |
600 | 600 | </form> |
601 | 601 | </div> |
@@ -610,26 +610,26 @@ discard block |
||
610 | 610 | 'show_all' => true |
611 | 611 | ); |
612 | 612 | |
613 | - echo paginate_links( $pagination_args ); |
|
613 | + echo paginate_links($pagination_args); |
|
614 | 614 | ?> |
615 | 615 | |
616 | 616 | <div id="give-customer-notes" class="postbox"> |
617 | - <?php if ( count( $customer_notes ) > 0 ) : ?> |
|
618 | - <?php foreach ( $customer_notes as $key => $note ) : ?> |
|
617 | + <?php if (count($customer_notes) > 0) : ?> |
|
618 | + <?php foreach ($customer_notes as $key => $note) : ?> |
|
619 | 619 | <div class="customer-note-wrapper dashboard-comment-wrap comment-item"> |
620 | 620 | <span class="note-content-wrap"> |
621 | - <?php echo stripslashes( $note ); ?> |
|
621 | + <?php echo stripslashes($note); ?> |
|
622 | 622 | </span> |
623 | 623 | </div> |
624 | 624 | <?php endforeach; ?> |
625 | 625 | <?php else: ?> |
626 | 626 | <div class="give-no-customer-notes"> |
627 | - <?php esc_html_e( 'No Donor Notes', 'give' ); ?> |
|
627 | + <?php esc_html_e('No Donor Notes', 'give'); ?> |
|
628 | 628 | </div> |
629 | 629 | <?php endif; ?> |
630 | 630 | </div> |
631 | 631 | |
632 | - <?php echo paginate_links( $pagination_args ); ?> |
|
632 | + <?php echo paginate_links($pagination_args); ?> |
|
633 | 633 | |
634 | 634 | </div> |
635 | 635 | |
@@ -645,9 +645,9 @@ discard block |
||
645 | 645 | * |
646 | 646 | * @return void |
647 | 647 | */ |
648 | -function give_customers_delete_view( $customer ) { |
|
648 | +function give_customers_delete_view($customer) { |
|
649 | 649 | |
650 | - $customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' ); |
|
650 | + $customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments'); |
|
651 | 651 | |
652 | 652 | /** |
653 | 653 | * Fires in donor delete screen, above the content. |
@@ -656,15 +656,15 @@ discard block |
||
656 | 656 | * |
657 | 657 | * @param object $customer The customer object being displayed. |
658 | 658 | */ |
659 | - do_action( 'give_customer_delete_top', $customer ); |
|
659 | + do_action('give_customer_delete_top', $customer); |
|
660 | 660 | ?> |
661 | 661 | |
662 | 662 | <div class="info-wrapper customer-section"> |
663 | 663 | |
664 | - <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 ); ?>"> |
|
664 | + <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); ?>"> |
|
665 | 665 | |
666 | 666 | <div class="customer-notes-header"> |
667 | - <?php echo get_avatar( $customer->email, 30 ); ?> <span><?php echo $customer->name; ?></span> |
|
667 | + <?php echo get_avatar($customer->email, 30); ?> <span><?php echo $customer->name; ?></span> |
|
668 | 668 | </div> |
669 | 669 | |
670 | 670 | |
@@ -672,16 +672,16 @@ discard block |
||
672 | 672 | |
673 | 673 | <span class="delete-customer-options"> |
674 | 674 | <p> |
675 | - <?php echo Give()->html->checkbox( array( 'name' => 'give-customer-delete-confirm' ) ); ?> |
|
676 | - <label for="give-customer-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label> |
|
675 | + <?php echo Give()->html->checkbox(array('name' => 'give-customer-delete-confirm')); ?> |
|
676 | + <label for="give-customer-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label> |
|
677 | 677 | </p> |
678 | 678 | |
679 | 679 | <p> |
680 | - <?php echo Give()->html->checkbox( array( |
|
680 | + <?php echo Give()->html->checkbox(array( |
|
681 | 681 | 'name' => 'give-customer-delete-records', |
682 | - 'options' => array( 'disabled' => true ) |
|
683 | - ) ); ?> |
|
684 | - <label for="give-customer-delete-records"><?php esc_html_e( 'Delete all associated payments and records?', 'give' ); ?></label> |
|
682 | + 'options' => array('disabled' => true) |
|
683 | + )); ?> |
|
684 | + <label for="give-customer-delete-records"><?php esc_html_e('Delete all associated payments and records?', 'give'); ?></label> |
|
685 | 685 | </p> |
686 | 686 | |
687 | 687 | <?php |
@@ -694,16 +694,16 @@ discard block |
||
694 | 694 | * |
695 | 695 | * @param object $customer The customer object being displayed. |
696 | 696 | */ |
697 | - do_action( 'give_customer_delete_inputs', $customer ); |
|
697 | + do_action('give_customer_delete_inputs', $customer); |
|
698 | 698 | ?> |
699 | 699 | </span> |
700 | 700 | |
701 | 701 | <span id="customer-edit-actions"> |
702 | 702 | <input type="hidden" name="customer_id" value="<?php echo $customer->id; ?>" /> |
703 | - <?php wp_nonce_field( 'delete-customer', '_wpnonce', false, true ); ?> |
|
703 | + <?php wp_nonce_field('delete-customer', '_wpnonce', false, true); ?> |
|
704 | 704 | <input type="hidden" name="give_action" value="delete-customer" /> |
705 | - <input type="submit" disabled="disabled" id="give-delete-customer" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" /> |
|
706 | - <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> |
|
705 | + <input type="submit" disabled="disabled" id="give-delete-customer" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" /> |
|
706 | + <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> |
|
707 | 707 | </span> |
708 | 708 | |
709 | 709 | </div> |
@@ -719,5 +719,5 @@ discard block |
||
719 | 719 | * |
720 | 720 | * @param object $customer The customer object being displayed. |
721 | 721 | */ |
722 | - do_action( 'give_customer_delete_bottom', $customer ); |
|
722 | + do_action('give_customer_delete_bottom', $customer); |
|
723 | 723 | } |
@@ -64,11 +64,14 @@ |
||
64 | 64 | }, 250 ); |
65 | 65 | </script> |
66 | 66 | |
67 | - <?php else : ?> |
|
67 | + <?php else { |
|
68 | + : ?> |
|
68 | 69 | |
69 | 70 | <div id="give-upgrade-status"> |
70 | 71 | <p style="font-size: 20px;max-width: 900px;"> |
71 | - <?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
72 | + <?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); |
|
73 | +} |
|
74 | +?> |
|
72 | 75 | <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
73 | 76 | </p> |
74 | 77 | </div> |
@@ -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_upgrades_screen() { |
24 | - $action = isset( $_GET['give-upgrade'] ) ? sanitize_text_field( $_GET['give-upgrade'] ) : ''; |
|
25 | - $step = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; |
|
26 | - $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; |
|
27 | - $custom = isset( $_GET['custom'] ) ? absint( $_GET['custom'] ) : 0; |
|
28 | - $number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 100; |
|
29 | - $steps = round( ( $total / $number ), 0 ); |
|
24 | + $action = isset($_GET['give-upgrade']) ? sanitize_text_field($_GET['give-upgrade']) : ''; |
|
25 | + $step = isset($_GET['step']) ? absint($_GET['step']) : 1; |
|
26 | + $total = isset($_GET['total']) ? absint($_GET['total']) : false; |
|
27 | + $custom = isset($_GET['custom']) ? absint($_GET['custom']) : 0; |
|
28 | + $number = isset($_GET['number']) ? absint($_GET['number']) : 100; |
|
29 | + $steps = round(($total / $number), 0); |
|
30 | 30 | |
31 | 31 | $doing_upgrade_args = array( |
32 | 32 | 'page' => 'give-upgrades', |
@@ -36,25 +36,25 @@ discard block |
||
36 | 36 | 'custom' => $custom, |
37 | 37 | 'steps' => $steps |
38 | 38 | ); |
39 | - update_option( 'give_doing_upgrade', $doing_upgrade_args ); |
|
40 | - if ( $step > $steps ) { |
|
39 | + update_option('give_doing_upgrade', $doing_upgrade_args); |
|
40 | + if ($step > $steps) { |
|
41 | 41 | // Prevent a weird case where the estimate was off. Usually only a couple. |
42 | 42 | $steps = $step; |
43 | 43 | } |
44 | 44 | ?> |
45 | 45 | <div class="wrap"> |
46 | - <h1><?php esc_html_e( 'Give - Upgrades', 'give' ); ?></h1> |
|
46 | + <h1><?php esc_html_e('Give - Upgrades', 'give'); ?></h1> |
|
47 | 47 | |
48 | - <?php if ( ! empty( $action ) ) : ?> |
|
48 | + <?php if ( ! empty($action)) : ?> |
|
49 | 49 | |
50 | 50 | <div id="give-upgrade-status"> |
51 | - <p style="font-size: 20px;max-width: 900px;"><?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
52 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
51 | + <p style="font-size: 20px;max-width: 900px;"><?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?> |
|
52 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
53 | 53 | </p> |
54 | 54 | |
55 | - <?php if ( ! empty( $total ) ) : ?> |
|
55 | + <?php if ( ! empty($total)) : ?> |
|
56 | 56 | <p> |
57 | - <strong><?php printf( esc_html__( 'Step %d of approximately %d running', 'give' ), $step, $steps ); ?></strong> |
|
57 | + <strong><?php printf(esc_html__('Step %d of approximately %d running', 'give'), $step, $steps); ?></strong> |
|
58 | 58 | </p> |
59 | 59 | <?php endif; ?> |
60 | 60 | </div> |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | |
69 | 69 | <div id="give-upgrade-status"> |
70 | 70 | <p style="font-size: 20px;max-width: 900px;"> |
71 | - <?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
72 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
71 | + <?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?> |
|
72 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
73 | 73 | </p> |
74 | 74 | </div> |
75 | 75 | <script type="text/javascript"> |
@@ -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,7 +20,7 @@ discard block |
||
20 | 20 | * @since 1.0 |
21 | 21 | * @return void |
22 | 22 | */ |
23 | -add_action( 'give_manual_cc_form', '__return_false' ); |
|
23 | +add_action('give_manual_cc_form', '__return_false'); |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Processes the purchase data and uses the Manual Payment gateway to record |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
35 | -function give_manual_payment( $purchase_data ) { |
|
35 | +function give_manual_payment($purchase_data) { |
|
36 | 36 | |
37 | - if ( ! wp_verify_nonce( $purchase_data['gateway_nonce'], 'give-gateway' ) ) { |
|
38 | - wp_die( esc_html__( 'Nonce verification has failed', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
37 | + if ( ! wp_verify_nonce($purchase_data['gateway_nonce'], 'give-gateway')) { |
|
38 | + wp_die(esc_html__('Nonce verification has failed', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | //Create payment_data array |
42 | 42 | $payment_data = array( |
43 | 43 | 'price' => $purchase_data['price'], |
44 | 44 | 'give_form_title' => $purchase_data['post_data']['give-form-title'], |
45 | - 'give_form_id' => intval( $purchase_data['post_data']['give-form-id'] ), |
|
45 | + 'give_form_id' => intval($purchase_data['post_data']['give-form-id']), |
|
46 | 46 | 'give_price_id' => isset($purchase_data['post_data']['give-price-id']) ? $purchase_data['post_data']['give-price-id'] : '', |
47 | 47 | 'date' => $purchase_data['date'], |
48 | 48 | 'user_email' => $purchase_data['user_email'], |
@@ -52,24 +52,24 @@ discard block |
||
52 | 52 | 'status' => 'pending' |
53 | 53 | ); |
54 | 54 | // Record the pending payment |
55 | - $payment = give_insert_payment( $payment_data ); |
|
55 | + $payment = give_insert_payment($payment_data); |
|
56 | 56 | |
57 | - if ( $payment ) { |
|
58 | - give_update_payment_status( $payment, 'publish' ); |
|
57 | + if ($payment) { |
|
58 | + give_update_payment_status($payment, 'publish'); |
|
59 | 59 | give_send_to_success_page(); |
60 | 60 | } else { |
61 | 61 | give_record_gateway_error( |
62 | - esc_html__( 'Payment Error', 'give' ), |
|
62 | + esc_html__('Payment Error', 'give'), |
|
63 | 63 | sprintf( |
64 | 64 | /* translators: %s: payment data */ |
65 | - esc_html__( 'The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give' ), |
|
66 | - json_encode( $payment_data ) |
|
65 | + esc_html__('The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give'), |
|
66 | + json_encode($payment_data) |
|
67 | 67 | ), |
68 | 68 | $payment |
69 | 69 | ); |
70 | 70 | // If errors are present, send the user back to the purchase page so they can be corrected |
71 | - give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] ); |
|
71 | + give_send_back_to_checkout('?payment-mode='.$purchase_data['post_data']['give-gateway']); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | -add_action( 'give_gateway_manual', 'give_manual_payment' ); |
|
75 | +add_action('give_gateway_manual', 'give_manual_payment'); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Profile_Editor extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['label'] = esc_html__( 'Profile Editor', 'give' ); |
|
21 | + $this->shortcode['label'] = esc_html__('Profile Editor', 'give'); |
|
22 | 22 | |
23 | - parent::__construct( 'give_profile_editor' ); |
|
23 | + parent::__construct('give_profile_editor'); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Donation_Receipt extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['title'] = esc_html__( 'Donation Receipt', 'give' ); |
|
22 | - $this->shortcode['label'] = esc_html__( 'Donation Receipt', 'give' ); |
|
21 | + $this->shortcode['title'] = esc_html__('Donation Receipt', 'give'); |
|
22 | + $this->shortcode['label'] = esc_html__('Donation Receipt', 'give'); |
|
23 | 23 | |
24 | - parent::__construct( 'give_receipt' ); |
|
24 | + parent::__construct('give_receipt'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -34,60 +34,60 @@ discard block |
||
34 | 34 | return array( |
35 | 35 | array( |
36 | 36 | 'type' => 'container', |
37 | - 'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'Optional settings', 'give' ) ), |
|
37 | + 'html' => sprintf('<p class="strong">%s</p>', esc_html__('Optional settings', 'give')), |
|
38 | 38 | ), |
39 | 39 | array( |
40 | 40 | 'type' => 'listbox', |
41 | 41 | 'name' => 'price', |
42 | - 'label' => esc_html__( 'Show Donation Amount:', 'give' ), |
|
42 | + 'label' => esc_html__('Show Donation Amount:', 'give'), |
|
43 | 43 | 'options' => array( |
44 | - 'true' => esc_html__( 'Show', 'give' ), |
|
45 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
44 | + 'true' => esc_html__('Show', 'give'), |
|
45 | + 'false' => esc_html__('Hide', 'give'), |
|
46 | 46 | ), |
47 | 47 | ), |
48 | 48 | array( |
49 | 49 | 'type' => 'listbox', |
50 | 50 | 'name' => 'donor', |
51 | - 'label' => esc_html__( 'Show Donor Name:', 'give' ), |
|
51 | + 'label' => esc_html__('Show Donor Name:', 'give'), |
|
52 | 52 | 'options' => array( |
53 | - 'true' => esc_html__( 'Show', 'give' ), |
|
54 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
53 | + 'true' => esc_html__('Show', 'give'), |
|
54 | + 'false' => esc_html__('Hide', 'give'), |
|
55 | 55 | ), |
56 | 56 | ), |
57 | 57 | array( |
58 | 58 | 'type' => 'listbox', |
59 | 59 | 'name' => 'date', |
60 | - 'label' => esc_html__( 'Show Date:', 'give' ), |
|
60 | + 'label' => esc_html__('Show Date:', 'give'), |
|
61 | 61 | 'options' => array( |
62 | - 'true' => esc_html__( 'Show', 'give' ), |
|
63 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
62 | + 'true' => esc_html__('Show', 'give'), |
|
63 | + 'false' => esc_html__('Hide', 'give'), |
|
64 | 64 | ), |
65 | 65 | ), |
66 | 66 | array( |
67 | 67 | 'type' => 'listbox', |
68 | 68 | 'name' => 'payment_key', |
69 | - 'label' => esc_html__( 'Show Payment Key:', 'give' ), |
|
69 | + 'label' => esc_html__('Show Payment Key:', 'give'), |
|
70 | 70 | 'options' => array( |
71 | - 'true' => esc_html__( 'Show', 'give' ), |
|
72 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
71 | + 'true' => esc_html__('Show', 'give'), |
|
72 | + 'false' => esc_html__('Hide', 'give'), |
|
73 | 73 | ), |
74 | 74 | ), |
75 | 75 | array( |
76 | 76 | 'type' => 'listbox', |
77 | 77 | 'name' => 'payment_method', |
78 | - 'label' => esc_html__( 'Show Payment Method:', 'give' ), |
|
78 | + 'label' => esc_html__('Show Payment Method:', 'give'), |
|
79 | 79 | 'options' => array( |
80 | - 'true' => esc_html__( 'Show', 'give' ), |
|
81 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
80 | + 'true' => esc_html__('Show', 'give'), |
|
81 | + 'false' => esc_html__('Hide', 'give'), |
|
82 | 82 | ), |
83 | 83 | ), |
84 | 84 | array( |
85 | 85 | 'type' => 'listbox', |
86 | 86 | 'name' => 'payment_id', |
87 | - 'label' => esc_html__( 'Show Payment ID:', 'give' ), |
|
87 | + 'label' => esc_html__('Show Payment ID:', 'give'), |
|
88 | 88 | 'options' => array( |
89 | - 'true' => esc_html__( 'Show', 'give' ), |
|
90 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
89 | + 'true' => esc_html__('Show', 'give'), |
|
90 | + 'false' => esc_html__('Hide', 'give'), |
|
91 | 91 | ), |
92 | 92 | ), |
93 | 93 | ); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Donation_History extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['label'] = esc_html__( 'Donation History', 'give' ); |
|
21 | + $this->shortcode['label'] = esc_html__('Donation History', 'give'); |
|
22 | 22 | |
23 | - parent::__construct( 'donation_history' ); |
|
23 | + parent::__construct('donation_history'); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Register extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['title'] = esc_html__( 'Register', 'give' ); |
|
22 | - $this->shortcode['label'] = esc_html__( 'Register', 'give' ); |
|
21 | + $this->shortcode['title'] = esc_html__('Register', 'give'); |
|
22 | + $this->shortcode['label'] = esc_html__('Register', 'give'); |
|
23 | 23 | |
24 | - parent::__construct( 'give_register' ); |
|
24 | + parent::__construct('give_register'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | return array( |
35 | 35 | array( |
36 | 36 | 'type' => 'container', |
37 | - 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Redirect URL (optional):', 'give' ) ), |
|
37 | + 'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Redirect URL (optional):', 'give')), |
|
38 | 38 | ), |
39 | 39 | array( |
40 | 40 | 'type' => 'textbox', |
41 | 41 | 'name' => 'redirect', |
42 | 42 | 'minWidth' => 320, |
43 | - 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after registering.', 'give' ), |
|
43 | + 'tooltip' => esc_attr__('Enter an URL here to redirect to after registering.', 'give'), |
|
44 | 44 | ), |
45 | 45 | ); |
46 | 46 | } |
@@ -11,12 +11,12 @@ 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 | |
18 | -require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export.php'; |
|
19 | -require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-actions.php'; |
|
18 | +require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export.php'; |
|
19 | +require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-actions.php'; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Process batch exports via ajax |
@@ -26,79 +26,79 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function give_do_ajax_export() { |
28 | 28 | |
29 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php'; |
|
29 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php'; |
|
30 | 30 | |
31 | - parse_str( $_POST['form'], $form ); |
|
31 | + parse_str($_POST['form'], $form); |
|
32 | 32 | |
33 | 33 | $_REQUEST = $form = (array) $form; |
34 | 34 | |
35 | - if ( ! wp_verify_nonce( $_REQUEST['give_ajax_export'], 'give_ajax_export' ) ) { |
|
36 | - die( '-2' ); |
|
35 | + if ( ! wp_verify_nonce($_REQUEST['give_ajax_export'], 'give_ajax_export')) { |
|
36 | + die('-2'); |
|
37 | 37 | } |
38 | 38 | |
39 | - do_action( 'give_batch_export_class_include', $form['give-export-class'] ); |
|
39 | + do_action('give_batch_export_class_include', $form['give-export-class']); |
|
40 | 40 | |
41 | - $step = absint( $_POST['step'] ); |
|
42 | - $class = sanitize_text_field( $form['give-export-class'] ); |
|
41 | + $step = absint($_POST['step']); |
|
42 | + $class = sanitize_text_field($form['give-export-class']); |
|
43 | 43 | |
44 | - $export = new $class( $step ); |
|
44 | + $export = new $class($step); |
|
45 | 45 | |
46 | - if ( ! $export->can_export() ) { |
|
47 | - die( '-1' ); |
|
46 | + if ( ! $export->can_export()) { |
|
47 | + die('-1'); |
|
48 | 48 | } |
49 | 49 | |
50 | - if ( ! $export->is_writable ) { |
|
50 | + if ( ! $export->is_writable) { |
|
51 | 51 | $json_args = array( |
52 | 52 | 'error' => true, |
53 | - 'message' => esc_html__( 'Export location or file not writable.', 'give' ) |
|
53 | + 'message' => esc_html__('Export location or file not writable.', 'give') |
|
54 | 54 | ); |
55 | 55 | echo json_encode($json_args); |
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | |
59 | - $export->set_properties( $_REQUEST ); |
|
59 | + $export->set_properties($_REQUEST); |
|
60 | 60 | |
61 | 61 | $export->pre_fetch(); |
62 | 62 | |
63 | - $ret = $export->process_step( $step ); |
|
63 | + $ret = $export->process_step($step); |
|
64 | 64 | |
65 | 65 | $percentage = $export->get_percentage_complete(); |
66 | 66 | |
67 | - if ( $ret ) { |
|
67 | + if ($ret) { |
|
68 | 68 | |
69 | 69 | $step += 1; |
70 | - echo json_encode( array( 'step' => $step, 'percentage' => $percentage ) ); |
|
70 | + echo json_encode(array('step' => $step, 'percentage' => $percentage)); |
|
71 | 71 | exit; |
72 | 72 | |
73 | - } elseif ( true === $export->is_empty ) { |
|
73 | + } elseif (true === $export->is_empty) { |
|
74 | 74 | |
75 | - echo json_encode( array( |
|
75 | + echo json_encode(array( |
|
76 | 76 | 'error' => true, |
77 | - 'message' => esc_html__( 'No data found for export parameters.', 'give' ) |
|
78 | - ) ); |
|
77 | + 'message' => esc_html__('No data found for export parameters.', 'give') |
|
78 | + )); |
|
79 | 79 | exit; |
80 | 80 | |
81 | - } elseif ( true === $export->done && true === $export->is_void ) { |
|
81 | + } elseif (true === $export->done && true === $export->is_void) { |
|
82 | 82 | |
83 | - $message = ! empty( $export->message ) ? $export->message : esc_html__( 'Batch Processing Complete', 'give' ); |
|
84 | - echo json_encode( array( 'success' => true, 'message' => $message ) ); |
|
83 | + $message = ! empty($export->message) ? $export->message : esc_html__('Batch Processing Complete', 'give'); |
|
84 | + echo json_encode(array('success' => true, 'message' => $message)); |
|
85 | 85 | exit; |
86 | 86 | |
87 | 87 | } else { |
88 | 88 | |
89 | - $args = array_merge( $_REQUEST, array( |
|
89 | + $args = array_merge($_REQUEST, array( |
|
90 | 90 | 'step' => $step, |
91 | 91 | 'class' => $class, |
92 | - 'nonce' => wp_create_nonce( 'give-batch-export' ), |
|
92 | + 'nonce' => wp_create_nonce('give-batch-export'), |
|
93 | 93 | 'give_action' => 'form_batch_export', |
94 | - ) ); |
|
94 | + )); |
|
95 | 95 | |
96 | - $download_url = add_query_arg( $args, admin_url() ); |
|
96 | + $download_url = add_query_arg($args, admin_url()); |
|
97 | 97 | |
98 | - echo json_encode( array( 'step' => 'done', 'url' => $download_url ) ); |
|
98 | + echo json_encode(array('step' => 'done', 'url' => $download_url)); |
|
99 | 99 | exit; |
100 | 100 | |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | -add_action( 'wp_ajax_give_do_ajax_export', 'give_do_ajax_export' ); |
|
104 | +add_action('wp_ajax_give_do_ajax_export', 'give_do_ajax_export'); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
11 | 11 | */ |
12 | 12 | |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -22,20 +22,20 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function give_process_batch_export_form() { |
24 | 24 | |
25 | - if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'give-batch-export' ) ) { |
|
26 | - wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
25 | + if ( ! wp_verify_nonce($_REQUEST['nonce'], 'give-batch-export')) { |
|
26 | + wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
27 | 27 | } |
28 | 28 | |
29 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php'; |
|
29 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php'; |
|
30 | 30 | |
31 | - do_action( 'give_batch_export_class_include', $_REQUEST['class'] ); |
|
31 | + do_action('give_batch_export_class_include', $_REQUEST['class']); |
|
32 | 32 | |
33 | 33 | $export = new $_REQUEST['class']; |
34 | 34 | $export->export(); |
35 | 35 | |
36 | 36 | } |
37 | 37 | |
38 | -add_action( 'give_form_batch_export', 'give_process_batch_export_form' ); |
|
38 | +add_action('give_form_batch_export', 'give_process_batch_export_form'); |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Exports earnings for a specified time period |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | * @return void |
47 | 47 | */ |
48 | 48 | function give_export_earnings() { |
49 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-earnings.php'; |
|
49 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-earnings.php'; |
|
50 | 50 | |
51 | 51 | $earnings_export = new Give_Earnings_Export(); |
52 | 52 | |
53 | 53 | $earnings_export->export(); |
54 | 54 | } |
55 | 55 | |
56 | -add_action( 'give_earnings_export', 'give_export_earnings' ); |
|
56 | +add_action('give_earnings_export', 'give_export_earnings'); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | /** |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | * @return void |
67 | 67 | */ |
68 | 68 | function give_export_all_customers() { |
69 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-customers.php'; |
|
69 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-customers.php'; |
|
70 | 70 | |
71 | 71 | $customer_export = new Give_Donors_Export(); |
72 | 72 | |
73 | 73 | $customer_export->export(); |
74 | 74 | } |
75 | 75 | |
76 | -add_action( 'give_email_export', 'give_export_all_customers' ); |
|
76 | +add_action('give_email_export', 'give_export_all_customers'); |
|
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Add a hook allowing extensions to register a hook on the batch export process |
@@ -82,22 +82,22 @@ discard block |
||
82 | 82 | * @return void |
83 | 83 | */ |
84 | 84 | function give_register_batch_exporters() { |
85 | - if ( is_admin() ) { |
|
86 | - do_action( 'give_register_batch_exporter' ); |
|
85 | + if (is_admin()) { |
|
86 | + do_action('give_register_batch_exporter'); |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | -add_action( 'plugins_loaded', 'give_register_batch_exporters' ); |
|
90 | +add_action('plugins_loaded', 'give_register_batch_exporters'); |
|
91 | 91 | |
92 | 92 | /** |
93 | 93 | * Register the payments batch exporter |
94 | 94 | * @since 1.5 |
95 | 95 | */ |
96 | 96 | function give_register_payments_batch_export() { |
97 | - add_action( 'give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1 ); |
|
97 | + add_action('give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1); |
|
98 | 98 | } |
99 | 99 | |
100 | -add_action( 'give_register_batch_exporter', 'give_register_payments_batch_export', 10 ); |
|
100 | +add_action('give_register_batch_exporter', 'give_register_payments_batch_export', 10); |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * Loads the payments batch process if needed |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | * |
109 | 109 | * @return void |
110 | 110 | */ |
111 | -function give_include_payments_batch_processor( $class ) { |
|
111 | +function give_include_payments_batch_processor($class) { |
|
112 | 112 | |
113 | - if ( 'Give_Batch_Payments_Export' === $class ) { |
|
114 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-payments.php'; |
|
113 | + if ('Give_Batch_Payments_Export' === $class) { |
|
114 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-payments.php'; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | } |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | * @since 1.5.2 |
122 | 122 | */ |
123 | 123 | function give_register_customers_batch_export() { |
124 | - add_action( 'give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1 ); |
|
124 | + add_action('give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1); |
|
125 | 125 | } |
126 | 126 | |
127 | -add_action( 'give_register_batch_exporter', 'give_register_customers_batch_export', 10 ); |
|
127 | +add_action('give_register_batch_exporter', 'give_register_customers_batch_export', 10); |
|
128 | 128 | |
129 | 129 | /** |
130 | 130 | * Loads the customers batch process if needed |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @return void |
137 | 137 | */ |
138 | -function give_include_customers_batch_processor( $class ) { |
|
138 | +function give_include_customers_batch_processor($class) { |
|
139 | 139 | |
140 | - if ( 'Give_Batch_Customers_Export' === $class ) { |
|
141 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-customers.php'; |
|
140 | + if ('Give_Batch_Customers_Export' === $class) { |
|
141 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-customers.php'; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | } |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | * @since 1.5 |
150 | 150 | */ |
151 | 151 | function give_register_forms_batch_export() { |
152 | - add_action( 'give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1 ); |
|
152 | + add_action('give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1); |
|
153 | 153 | } |
154 | 154 | |
155 | -add_action( 'give_register_batch_exporter', 'give_register_forms_batch_export', 10 ); |
|
155 | +add_action('give_register_batch_exporter', 'give_register_forms_batch_export', 10); |
|
156 | 156 | |
157 | 157 | /** |
158 | 158 | * Loads the file downloads batch process if needed |
@@ -163,10 +163,10 @@ discard block |
||
163 | 163 | * |
164 | 164 | * @return void |
165 | 165 | */ |
166 | -function give_include_forms_batch_processor( $class ) { |
|
166 | +function give_include_forms_batch_processor($class) { |
|
167 | 167 | |
168 | - if ( 'Give_Batch_Forms_Export' === $class ) { |
|
169 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-forms.php'; |
|
168 | + if ('Give_Batch_Forms_Export' === $class) { |
|
169 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-forms.php'; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | } |
173 | 173 | \ No newline at end of file |