Pagination Links Broken
|Reported by:||ssmathias||Owned by:|
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.