Opened 7 years ago
Closed 4 years ago
#44513 closed defect (bug) (invalid)
bug in paginate_links function
Reported by: | luca74 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
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 (3)
Note: See
TracTickets for help on using
tickets.
@luca74 Hello and welcome to trac!
This ticket was discussed in a triage session today.
paginate_links()
is designed to assume that page one is the default, this is to allow the paging URLs to follow the formwordpress.org/my-post/2/
with the first page beenwordpress.org/my-post
I'm going to close this ticket of as
invalid
, which in this case is trac's unfriendly term to mean the function is working as intended.Thanks.