Skip to content

Commit

Permalink
Merge pull request #2441 from rebeccahum/rebecca/account_for_offset_i…
Browse files Browse the repository at this point in the history
…n_size_for_comments

When using default max result window value for size, we should account for offsets
  • Loading branch information
felipeelia committed Nov 5, 2021
2 parents 16c56cb + d4bff90 commit db1c2a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions includes/classes/Indexable/Comment/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public function format_args( $query_vars ) {
*/
if ( isset( $query_vars['offset'] ) ) {
$formatted_args['from'] = (int) $query_vars['offset'];
if ( empty( $query_vars['number'] ) ) {
$formatted_args['size'] -= (int) $formatted_args['from'];
}
}

/**
Expand Down

0 comments on commit db1c2a7

Please sign in to comment.