Make WordPress Core

Opened 12 years ago

Last modified 6 years ago

#23229 new defect (bug)

Pagination Links Broken

Reported by: ssmathias's profile ssmathias Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: needs-refresh
Focuses: Cc:

Description

Currently, if the request URL ends with "page/[\d]+/?" it will always assume that it is the pretty version of the paged parameter, and rewrite that section of the URL.

This breaks in any condition where a numeric value follows that string at the end of a URL. An example that can be easily reproduced is as follows:

1) Set theme to TwentyEleven

2) Modify the theme to output the results of get_pagenum_link(2) anywhere.

3) Change permalink structure to "/daily-page/%year%/%monthnum%/%post_id%/"

4) Go to a year archive for the permalink structure above.

5) The result of the get_pagenum_link will look like this: "/daily-/page/2/", breaking pagination within this context.

I've attached a patch against current trunk code that addresses this, providing the following features:

1) Pagination links functional in the scenario above, along with custom rewrite rules.

2) Updated to allow numeric post names for hierarchical post types (currently always rewritten with "-2")

3) Updated get_pagenum_link filter to include pagenum parameter as it was passed in.

Attachments (1)

23229-r23303.diff (4.5 KB) - added by ssmathias 12 years ago.
Patch against revision 23303 in trunk

Download all attachments as: .zip

Change History (3)

@ssmathias
12 years ago

Patch against revision 23303 in trunk

#1 @SergeyBiryukov
12 years ago

2) Updated to allow numeric post names for hierarchical post types (currently always rewritten with "-2"

Related: #5305

#2 @chriscct7
9 years ago

  • Keywords needs-refresh added; has-patch removed
Note: See TracTickets for help on using tickets.