PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
← All changes | includes/admin/donors/class-donor-table.php +243 -103 2.3.2 → 4.17.0 View file →
@@ -58,47 +58,122 @@
58 58 * @since 1.0
59 59 * @see WP_List_Table::__construct()
60 60 */
61 61 public function __construct() {
62 -
63 62 // Set parent defaults.
64 - parent::__construct( array(
65 - 'singular' => __( 'Donor', 'give' ), // Singular name of the listed records.
66 - 'plural' => __( 'Donors', 'give' ), // Plural name of the listed records.
67 - 'ajax' => false, // Does this table support ajax?.
68 - ) );
63 + parent::__construct(
64 + [
65 + 'singular' => __( 'Donor', 'give' ), // Singular name of the listed records.
66 + 'plural' => __( 'Donors', 'give' ), // Plural name of the listed records.
67 + 'ajax' => false, // Does this table support ajax?.
68 + ]
69 + );
69 70
70 71 }
71 -
72 72 /**
73 - * Show the search field.
73 + * Add donors search filter.
74 74 *
75 - * @param string $text Label for the search box.
76 - * @param string $input_id ID of the search box.
77 - *
78 - * @since 1.0
79 - * @access public
80 - *
75 + * @since 3.5.0 Escape search query string.
76 + * @since 2.4.0
81 77 * @return void
82 78 */
83 - public function search_box( $text, $input_id ) {
84 - $input_id = $input_id . '-search-input';
79 + public function advanced_filters() {
80 + $start_date = isset( $_GET['start-date'] ) ? strtotime( give_clean( $_GET['start-date'] ) ) : '';
81 + $end_date = isset( $_GET['end-date'] ) ? strtotime( give_clean( $_GET['end-date'] ) ) : '';
82 + $status = isset( $_GET['status'] ) ? give_clean( $_GET['status'] ) : '';
83 + $donor = isset( $_GET['donor'] ) ? absint( $_GET['donor'] ) : '';
84 + $search = $this->get_search();
85 + $form_id = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0;
86 + ?>
87 + <div id="give-donor-filters" class="give-filters">
88 + <div class="give-donor-search-box">
89 + <input type="text" id="give-donors-search-input" placeholder="<?php
90 + _e('Name, Email, or Donor ID', 'give'); ?>" name="s" value="<?php
91 + echo esc_attr($search); ?>">
92 + <?php
93 + submit_button(
94 + __( 'Search', 'give' ),
95 + 'button',
96 + false,
97 + false,
98 + [
99 + 'ID' => 'donor-search-submit',
100 + ]
101 + );
102 + ?>
103 + </div>
104 + <div class="give-filter give-filter-half">
105 + <label for="start-date"
106 + class="give-start-date-label"><?php _e( 'Start Date', 'give' ); ?></label>
107 + <input type="text"
108 + id="start-date"
109 + name="start-date"
110 + class="give_datepicker"
111 + autocomplete="off"
112 + value="<?php echo $start_date ? date_i18n( give_date_format(), $start_date ) : ''; ?>"
113 + data-standard-date="<?php echo $start_date ? date( 'Y-m-d', $start_date ) : $start_date; ?>"
114 + placeholder="<?php _e( 'Start Date', 'give' ); ?>"
115 + />
116 + </div>
117 + <div class="give-filter give-filter-half">
118 + <label for="end-date" class="give-end-date-label"><?php _e( 'End Date', 'give' ); ?></label>
119 + <input type="text"
120 + id="end-date"
121 + name="end-date"
122 + class="give_datepicker"
123 + autocomplete="off"
124 + value="<?php echo $end_date ? date_i18n( give_date_format(), $end_date ) : ''; ?>"
125 + data-standard-date="<?php echo $end_date ? date( 'Y-m-d', $end_date ) : $end_date; ?>"
126 + placeholder="<?php _e( 'End Date', 'give' ); ?>"
127 + />
128 + </div>
129 + <div id="give-payment-form-filter" class="give-filter">
130 + <label for="give-donation-forms-filter"
131 + class="give-donation-forms-filter-label"><?php _e( 'Form', 'give' ); ?></label>
132 + <?php
133 + // Filter Donations by Donation Forms.
134 + echo Give()->html->forms_dropdown(
135 + [
136 + 'name' => 'form_id',
137 + 'id' => 'give-donation-forms-filter',
138 + 'class' => 'give-donation-forms-filter',
139 + 'selected' => $form_id, // Make sure to have $form_id set to 0, if there is no selection.
140 + 'chosen' => true,
141 + 'number' => 30,
142 + ]
143 + );
144 + ?>
145 + </div>
85 146
86 - if ( ! empty( $_REQUEST['orderby'] ) ) {
87 - echo sprintf( '<input type="hidden" name="orderby" value="%1$s" />', esc_attr( $_REQUEST['orderby'] ) );
88 - }
147 + <?php
148 + /**
149 + * Action to add hidden fields and HTML in donor search.
150 + *
151 + * @since 2.4.0
152 + */
153 + do_action( 'give_donor_table_advanced_filters' );
89 154
90 - if ( ! empty( $_REQUEST['order'] ) ) {
91 - echo sprintf( '<input type="hidden" name="order" value="%1$s" />', esc_attr( $_REQUEST['order'] ) );
92 - }
93 - ?>
94 - <p class="search-box" role="search">
95 - <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
96 - <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
97 - <?php submit_button( $text, 'button', false, false, array(
98 - 'ID' => 'search-submit',
99 - ) ); ?>
100 - </p>
155 + if ( ! empty( $status ) ) {
156 + echo sprintf( '<input type="hidden" name="status" value="%s"/>', esc_attr( $status ) );
157 + }
158 +
159 + if ( ! empty( $donor ) ) {
160 + echo sprintf( '<input type="hidden" name="donor" value="%s"/>', absint( $donor ) );
161 + }
162 + ?>
163 +
164 + <div class="give-filter">
165 + <?php submit_button( __( 'Apply', 'give' ), 'secondary', '', false ); ?>
166 + <?php
167 + // Clear active filters button.
168 + if ( ! empty( $start_date ) || ! empty( $end_date ) || ! empty( $donor ) || ! empty( $search ) || ! empty( $status ) || ! empty( $form_id ) ) :
169 + ?>
170 + <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>"
171 + class="button give-clear-filters-button"><?php _e( 'Clear Filters', 'give' ); ?></a>
172 + <?php endif; ?>
173 + </div>
174 + </div>
175 +
101 176 <?php
102 177 }
103 178
104 179 /**
@@ -103,9 +178,9 @@
103 178
104 179 /**
105 180 * This function renders most of the columns in the list table.
106 181 *
107 - * @param array $donor Contains all the data of the donors.
182 + * @param array $donor Contains all the data of the donors.
108 183 * @param string $column_name The name of the column.
109 184 *
110 185 * @access public
111 186 * @since 1.0
@@ -115,9 +190,9 @@
115 190 public function column_default( $donor, $column_name ) {
116 191
117 192 switch ( $column_name ) {
118 193
119 - case 'num_donations' :
194 + case 'num_donations':
120 195 $value = sprintf(
121 196 '<a href="%s">%s</a>',
122 197 admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor['id'] ) ),
123 198 esc_html( $donor['num_donations'] )
@@ -123,16 +198,20 @@
123 198 esc_html( $donor['num_donations'] )
124 199 );
125 200 break;
126 201
127 - case 'amount_spent' :
128 - $value = give_currency_filter( give_format_amount( $donor[ $column_name ], array( 'sanitize' => false ) ) );
202 + case 'amount_spent':
203 + $value = give_currency_filter( give_format_amount( $donor[ $column_name ], [ 'sanitize' => false ] ) );
129 204 break;
130 205
131 - case 'date_created' :
206 + case 'date_created':
132 207 $value = date_i18n( give_date_format(), strtotime( $donor['date_created'] ) );
133 208 break;
134 209
210 + case 'email':
211 + $value = esc_html( $donor[ $column_name ] );
212 + break;
213 +
135 214 default:
136 215 $value = isset( $donor[ $column_name ] ) ? $donor[ $column_name ] : null;
137 216 break;
138 217 }
@@ -169,13 +248,44 @@
169 248 *
170 249 * @return string
171 250 */
172 251 public function column_name( $donor ) {
173 - $name = ! empty( $donor['name'] ) ? $donor['name'] : '<em>' . __( 'Unnamed Donor', 'give' ) . '</em>';
174 - $view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor['id'] );
252 +
253 + // Get donor's initials for non-gravatars
254 + $title_prefix = Give()->donor_meta->get_meta( $donor['id'], '_give_donor_title_prefix', true );
255 + $donor_name_without_prefix = trim( str_replace( $title_prefix, '', $donor['name'] ) );
256 + $donor_name_array = explode( ' ', $donor_name_without_prefix );
257 + $donor_name_args['firstname'] = ! empty( $donor_name_array[0] ) ? $donor_name_array[0] : '';
258 + $donor_name_args['lastname'] = ! empty( $donor_name_array[1] ) ? $donor_name_array[1] : '';
259 + $donor_name_initial = give_get_name_initial( $donor_name_args );
260 +
261 + $donation_gravatar_image = sprintf(
262 + '<span class="give-donor__image give-donor-admin-avatar" data-donor_email="%1$s" data-has-valid-gravatar="%2$s">%3$s</span>',
263 + md5( strtolower( trim( $donor['email'] ) ) ),
264 + absint( give_validate_gravatar( $donor['email'] ) ),
265 + esc_attr( $donor_name_initial )
266 + );
267 +
268 + $name = ! empty( $donor['name'] )
269 + ? sprintf(
270 + '%1$s<span class="give-donor-name-text">%2$s</span>',
271 + $donation_gravatar_image,
272 + esc_attr( $donor['name'] )
273 + )
274 + : sprintf(
275 + '<em>%1$s</em>',
276 + __( 'Unnamed Donor', 'give' )
277 + );
278 +
279 + $view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=legacy-overview&id=' . $donor['id'] );
175 280 $actions = $this->get_row_actions( $donor );
176 281
177 - return '<a href="' . esc_url( $view_url ) . '">' . esc_attr( $name ) . '</a>' . $this->row_actions( $actions );
282 + return sprintf(
283 + '<a href="%1$s" class="give-donor-name">%2$s</a>%3$s',
284 + esc_url( $view_url ),
285 + $name,
286 + $this->row_actions( $actions )
287 + );
178 288 }
179 289
180 290 /**
181 291 * Retrieve the table columns.
@@ -185,9 +295,9 @@
185 295 *
186 296 * @return array $columns Array of all the list table columns.
187 297 */
188 298 public function get_columns() {
189 - $columns = array(
299 + $columns = [
190 300 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text.
191 301 'name' => __( 'Name', 'give' ),
192 302 'email' => __( 'Email', 'give' ),
193 303 'num_donations' => __( 'Donations', 'give' ),
@@ -192,9 +302,9 @@
192 302 'email' => __( 'Email', 'give' ),
193 303 'num_donations' => __( 'Donations', 'give' ),
194 304 'amount_spent' => __( 'Total Donated', 'give' ),
195 305 'date_created' => __( 'Date Created', 'give' ),
196 - );
306 + ];
197 307
198 308 return apply_filters( 'give_list_donors_columns', $columns );
199 309
200 310 }
@@ -207,14 +317,14 @@
207 317 * @return array Array of all the sortable columns.
208 318 */
209 319 public function get_sortable_columns() {
210 320
211 - $columns = array(
212 - 'date_created' => array( 'date_created', true ),
213 - 'name' => array( 'name', true ),
214 - 'num_donations' => array( 'purchase_count', false ),
215 - 'amount_spent' => array( 'purchase_value', false ),
216 - );
321 + $columns = [
322 + 'date_created' => [ 'date_created', true ],
323 + 'name' => [ 'name', true ],
324 + 'num_donations' => [ 'purchase_count', false ],
325 + 'amount_spent' => [ 'purchase_value', false ],
326 + ];
217 327
218 328 return apply_filters( 'give_list_donors_sortable_columns', $columns );
219 329 }
220 330
@@ -229,13 +339,13 @@
229 339 * @return array An array of action links.
230 340 */
231 341 public function get_row_actions( $donor ) {
232 342
233 - $actions = array(
234 - 'view' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor['id'] ), sprintf( esc_attr__( 'View "%s"', 'give' ), esc_attr( $donor['name'] ) ), __( 'View Donor', 'give' ) ),
235 - 'notes' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor['id'] ), sprintf( esc_attr__( 'Notes for "%s"', 'give' ), esc_attr( $donor['name'] ) ), __( 'Notes', 'give' ) ),
236 - 'delete' => sprintf( '<a class="%1$s" data-id="%2$s" href="#" aria-label="%3$s">%4$s</a>', 'give-single-donor-delete', $donor['id'],sprintf( esc_attr__( 'Delete "%s"', 'give' ), esc_attr( $donor['name'] ) ), __( 'Delete', 'give' ) ),
237 - );
343 + $actions = [
344 + 'id' => '<span class="give-donor-id">ID: ' . $donor['id'] . ' </span>',
345 + 'view' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=legacy-overview&id=' . $donor['id'] ), sprintf( esc_attr__( 'View "%s"', 'give' ), esc_attr( $donor['name'] ) ), __( 'View Donor', 'give' ) ),
346 + 'delete' => sprintf( '<a class="%1$s" data-id="%2$s" href="#" aria-label="%3$s">%4$s</a>', 'give-single-donor-delete', $donor['id'], sprintf( esc_attr__( 'Delete "%s"', 'give' ), esc_attr( $donor['name'] ) ), __( 'Delete', 'give' ) ),
347 + ];
238 348
239 349 return apply_filters( 'give_donor_row_actions', $actions, $donor );
240 350
241 351 }
@@ -255,14 +365,22 @@
255 365 /**
256 366 * Retrieves the search query string.
257 367 *
258 368 * @access public
369 + * @since 3.5.0 Remove escape function
259 370 * @since 1.0
260 371 *
261 372 * @return mixed string If search is present, false otherwise.
262 373 */
263 374 public function get_search() {
264 - return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
375 +
376 + if ( ! isset( $_GET['s'] ) ) {
377 + return false;
378 + }
379 +
380 + $search = urldecode(trim($_GET['s']));
381 +
382 + return ! empty($search) ? $search : false;
265 383 }
266 384
267 385 /**
268 386 * Get the Bulk Actions.
@@ -272,11 +390,12 @@
272 390 *
273 391 * @return array
274 392 */
275 393 public function get_bulk_actions() {
276 - $actions = array(
394 + $actions = [
277 395 'delete' => __( 'Delete', 'give' ),
278 - );
396 + ];
397 +
279 398 return $actions;
280 399 }
281 400
282 401 /**
@@ -288,9 +407,9 @@
288 407 * @since 1.8.16
289 408 */
290 409 protected function display_tablenav( $which ) {
291 410 if ( 'top' === $which ) {
292 - wp_nonce_field( 'bulk-donors','_wpnonce', false );
411 + wp_nonce_field( 'bulk-donors', '_wpnonce', false );
293 412 }
294 413 ?>
295 414 <div class="tablenav <?php echo esc_attr( $which ); ?>">
296 415 <?php if ( $this->has_items() ) : ?>
@@ -296,13 +415,14 @@
296 415 <?php if ( $this->has_items() ) : ?>
297 416 <div class="alignleft actions bulkactions">
298 417 <?php $this->bulk_actions( $which ); ?>
299 418 </div>
300 - <?php endif;
419 + <?php
420 + endif;
301 421 $this->extra_tablenav( $which );
302 422 $this->pagination( $which );
303 423 ?>
304 - <br class="clear" />
424 + <br class="clear"/>
305 425 </div>
306 426 <?php
307 427 }
308 428
@@ -308,9 +428,9 @@
308 428
309 429 /**
310 430 * Retrieves the donor data from db.
311 431 *
312 - * @access public
432 + * @since 2.21.2 Add second param to "give_donors_column_query_data" filter hook.
313 433 * @since 1.0
314 434 *
315 435 * @return array $data The Donor data.
316 436 */
@@ -315,9 +435,9 @@
315 435 * @return array $data The Donor data.
316 436 */
317 437 public function donor_data() {
318 438
319 - $data = array();
439 + $data = [];
320 440
321 441 // Get donor query.
322 442 $args = $this->get_donor_query();
323 443 $donors = Give()->donors->get_donors( $args );
@@ -331,9 +451,9 @@
331 451
332 452 // If title prefix is set, then update the donor name.
333 453 $donor->name = give_get_donor_name_with_title_prefixes( $title_prefix, $donor->name );
334 454
335 - $data[] = array(
455 + $data[] = [
336 456 'id' => $donor->id,
337 457 'user_id' => $user_id,
338 458 'name' => $donor->name,
339 459 'email' => $donor->email,
@@ -339,13 +459,13 @@
339 459 'email' => $donor->email,
340 460 'num_donations' => $donor->purchase_count,
341 461 'amount_spent' => $donor->purchase_value,
342 462 'date_created' => $donor->date_created,
343 - );
463 + ];
344 464 }
345 465 }
346 466
347 - return apply_filters( 'give_donors_column_query_data', $data );
467 + return apply_filters( 'give_donors_column_query_data', $data, $donors );
348 468 }
349 469
350 470 /**
351 471 * Get donor count.
@@ -358,16 +478,17 @@
358 478 $_donor_query = $this->get_donor_query();
359 479
360 480 $_donor_query['number'] = - 1;
361 481 $_donor_query['offset'] = 0;
362 - $donors = Give()->donors->get_donors( $_donor_query );
482 + $_donor_query['count'] = true;
363 483
364 - return count( $donors );
484 + return Give()->donors->get_donors( $_donor_query );
365 485 }
366 486
367 487 /**
368 488 * Get donor query.
369 489 *
490 + * @since 3.5.0 Escape search query string.
370 491 * @since 1.8.1
371 492 * @access public
372 493 *
373 494 * @return array
@@ -372,30 +493,39 @@
372 493 *
373 494 * @return array
374 495 */
375 496 public function get_donor_query() {
376 - $paged = $this->get_paged();
377 - $offset = $this->per_page * ( $paged - 1 );
378 - $search = $this->get_search();
379 - $order = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC';
380 - $orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id';
497 + $per_page = $this->per_page;
498 + $paged = $this->get_paged();
499 + $donor = isset( $_GET['donor'] ) ? absint( $_GET['donor'] ) : null;
500 + $start_date = ! empty( $_GET['start-date'] ) ? strtotime( give_clean( $_GET['start-date'] ) ) : false;
501 + $end_date = ! empty( $_GET['end-date'] ) ? strtotime( give_clean( $_GET['end-date'] ) ) : false;
502 + $form_id = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : null;
503 + $offset = $this->per_page * ( $paged - 1 );
504 + $search = $this->get_search();
505 + $order = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC';
506 + $orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id';
381 507
382 - $args = array(
383 - 'number' => $this->per_page,
384 - 'offset' => $offset,
385 - 'order' => $order,
386 - 'orderby' => $orderby,
387 - );
508 + $args = [
509 + 'output' => 'payments',
510 + 'number' => $per_page,
511 + 'offset' => $offset,
512 + 'page' => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
513 + 'orderby' => $orderby,
514 + 'order' => $order,
515 + 'donor' => $donor,
516 + 's' => esc_sql($search),
517 + 'start_date' => $start_date,
518 + 'end_date' => $end_date,
519 + 'give_forms' => $form_id,
520 + ];
388 521
389 - if ( $search ) {
390 - if ( is_email( $search ) ) {
391 - $args['email'] = $search;
392 - } elseif ( is_numeric( $search ) ) {
393 - $args['id'] = $search;
394 - } else {
395 - $args['name'] = $search;
396 - }
397 - }
522 + /**
523 + * Filter to modify donor table argument.
524 + *
525 + * @since 2.4.0
526 + */
527 + $args = (array) apply_filters( 'give_donor_table_query', $args );
398 528
399 529 return $args;
400 530 }
401 531
@@ -415,9 +545,9 @@
415 545
416 546 /**
417 547 * Display the final donor table
418 548 *
419 - * @since 1.8.17
549 + * @since 1.8.17
420 550 * @access public
421 551 */
422 552 public function display() {
423 553 $singular = $this->_args['singular'];
@@ -427,11 +557,10 @@
427 557 $this->screen->render_screen_reader_content( 'heading_list' );
428 558
429 559 $get_data = give_clean( $_GET ); // WPCS: input var ok, sanitization ok, CSRF ok.
430 560
431 - $search_keyword = ! empty( $get_data['s'] ) ? $get_data['s'] : '';
432 - $order = ! empty( $get_data['order'] ) ? $get_data['order'] : 'DESC';
433 - $order_by = ! empty( $get_data['orderby'] ) ? $get_data['orderby'] : 'id';
561 + $order = ! empty( $get_data['order'] ) ? $get_data['order'] : 'DESC';
562 + $order_by = ! empty( $get_data['orderby'] ) ? $get_data['orderby'] : 'id';
434 563 ?>
435 564 <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
436 565 <thead>
437 566 <tr>
@@ -438,14 +567,19 @@
438 567 <?php $this->print_column_headers(); ?>
439 568 </tr>
440 569 </thead>
441 570
442 - <tbody id="the-list"<?php
571 + <tbody id="the-list"
572 + <?php
443 573 if ( $singular ) {
444 574 echo " data-wp-lists='list:$singular'";
445 - } ?>>
575 + }
576 + ?>
577 + >
446 578 <tr class="hidden"></tr>
447 - <tr id="give-bulk-delete" class="inline-edit-row inline-edit-row-page inline-edit-page bulk-edit-row bulk-edit-row-page bulk-edit-page inline-editor" style="display: none;" >
579 + <tr id="give-bulk-delete"
580 + class="inline-edit-row inline-edit-row-page inline-edit-page bulk-edit-row bulk-edit-row-page bulk-edit-page inline-editor"
581 + style="display: none;">
448 582 <td colspan="6" class="colspanchange">
449 583
450 584 <fieldset class="inline-edit-col-left">
451 585 <legend class="inline-edit-legend"><?php esc_attr_e( 'BULK DELETE', 'give' ); ?></legend>
@@ -459,13 +593,15 @@
459 593
460 594 <fieldset class="inline-edit-col-right">
461 595 <div class="inline-edit-col">
462 596 <label>
463 - <input class="give-donor-delete-confirm" type="checkbox" name="give-donor-delete-confirm"/>
597 + <input class="give-donor-delete-confirm" type="checkbox"
598 + name="give-donor-delete-confirm"/>
464 599 <?php esc_attr_e( 'Are you sure you want to delete the selected donor(s)?', 'give' ); ?>
465 600 </label>
466 601 <label>
467 - <input class="give-donor-delete-records" type="checkbox" name="give-donor-delete-records"/>
602 + <input class="give-donor-delete-records" type="checkbox"
603 + name="give-donor-delete-records"/>
468 604 <?php esc_attr_e( 'Delete all associated donations and records?', 'give' ); ?>
469 605 </label>
470 606 </div>
471 607 </fieldset>
@@ -471,13 +607,15 @@
471 607 </fieldset>
472 608
473 609 <p class="submit inline-edit-save">
474 610 <input type="hidden" name="give_action" value="delete_bulk_donor"/>
475 - <input type="hidden" name="s" value="<?php echo esc_html( $search_keyword ); ?>"/>
476 611 <input type="hidden" name="orderby" value="<?php echo esc_html( $order_by ); ?>"/>
477 612 <input type="hidden" name="order" value="<?php echo esc_html( $order ); ?>"/>
478 - <button type="button" id="give-bulk-delete-cancel" class="button cancel alignleft"><?php esc_attr_e( 'Cancel', 'give' ); ?></button>
479 - <input type="submit" id="give-bulk-delete-button" disabled class="button button-primary alignright" value="<?php esc_attr_e( 'Delete', 'give' ); ?>">
613 + <button type="button" id="give-bulk-delete-cancel"
614 + class="button cancel alignleft"><?php esc_attr_e( 'Cancel', 'give' ); ?></button>
615 + <input type="submit" id="give-bulk-delete-button" disabled
616 + class="button button-primary alignright"
617 + value="<?php esc_attr_e( 'Delete', 'give' ); ?>">
480 618 <br class="clear">
481 619 </p>
482 620 </td>
483 621 </tr>
@@ -505,20 +643,22 @@
505 643 */
506 644 public function prepare_items() {
507 645
508 646 $columns = $this->get_columns();
509 - $hidden = array(); // No hidden columns.
647 + $hidden = []; // No hidden columns.
510 648 $sortable = $this->get_sortable_columns();
511 649
512 - $this->_column_headers = array( $columns, $hidden, $sortable );
650 + $this->_column_headers = [ $columns, $hidden, $sortable ];
513 651
514 652 $this->items = $this->donor_data();
515 653
516 654 $this->total = $this->get_donor_count();
517 655
518 - $this->set_pagination_args( array(
519 - 'total_items' => $this->total,
520 - 'per_page' => $this->per_page,
521 - 'total_pages' => ceil( $this->total / $this->per_page ),
522 - ) );
656 + $this->set_pagination_args(
657 + [
658 + 'total_items' => $this->total,
659 + 'per_page' => $this->per_page,
660 + 'total_pages' => ceil( $this->total / $this->per_page ),
661 + ]
662 + );
523 663 }
524 664 }