Skip to content

Commit

Permalink
feat(test): set pagination args to show number of items but without a…
Browse files Browse the repository at this point in the history
…ctual pagination
  • Loading branch information
harunbleech committed May 23, 2024
1 parent f2b475a commit 072e8e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions includes/list-tables/class-tests-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,18 @@ public function prepare_items() {
// Process any bulk actions.
$this->process_bulk_action();
$this->items = Test::get_items( $args );

$total_items = 0;
if ( null !== $args['filter_status'] ) {
$total_items = Test::get_total_items( $filter_status_query );
} else {
$total_items = Test::get_total_items();
}

$this->set_pagination_args([
'total_items' => $total_items,
'per_page' => 100000, // we set it to a high number to avoid pagination.
]);
}

/**
Expand Down

0 comments on commit 072e8e6

Please sign in to comment.