Skip to content

Commit

Permalink
Use class property instead of $current for proper semantics
Browse files Browse the repository at this point in the history
$current is a 0-based array index whereas $this->current is the page number. Using $current introduces a bug, since it clears $this->prev on page 2.
  • Loading branch information
phasdev committed Feb 26, 2024
1 parent 38b7906 commit 7f261c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected function init($prefs = [], $wp_query = null)
'class' => 'page-numbers prev',
];
}
if ($current < 2) {
if ($this->current < 2) {
$this->prev = '';
}
if ($this->total === (float) 0) {
Expand Down

0 comments on commit 7f261c7

Please sign in to comment.