Make WordPress Core

Opened 6 years ago

Last modified 3 years ago

#44513 closed defect (bug)

bug in paginate_links function — at Version 1

Reported by: luca74's profile luca74 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.1
Component: General Keywords:
Focuses: Cc:

Description (last modified by sabernhardt)

Hi,
I've used the paginate_links function, but I find a bug, and solve it.
if you are in page 2, and you want to go at page 1 (clicking on the number) or on previous text, the pagination not works: it's missing the ?page=1
So I take a look on the script and I've change:

File: includes/general-template.php

Line 3771
FROM:
$link = str_replace( '%_%', 2 == $current ? '' : $args['format'], $args['base'] );

TO:
$link = str_replace( '%_%', 1 == $current ? '' : $args['format'], $args['base'] );

LINE 3792
FROM:
$link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] );

TO:
$link = str_replace( '%_%', 0 == $n ? '' : $args['format'], $args['base'] );

Change History (1)

#1 @sabernhardt
3 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.