Opened 9 years ago
Last modified 7 months ago
#32295 new defect (bug)
Pagination on preview/scheduled posts
Reported by: | jacklyn.jade | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.2.2 |
Component: | Posts, Post Types | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
The option to add a NextPage (Pagination) is not functioning in page previews or when a post/page is scheduled to be published.
<!--nextpage-->
The expected outcome is when adding the code for nextpage, you get links to Page 1, 2, etc. and when you click those links, you are taken to more content.
However, when a page/post is not PUBLISHED but is in Preview or Scheduled, the Pagination does not function as expected. Clicking on Page 2 refreshes the page and shows the content on page 1 again.
When the page is published, everything works as expected, but for someone who is trying to preview their post before publishing, this is not helpful.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
We are hitting this as well. The issue seems to be that when you hit "view post" on a scheduled post it uses the permalink, but if you hit preview it uses the ?p=<post_id> link, and wp_link_pages gets confused about how to correctly create the link. (It does /?p=52248/2). A potential fix is to always use ?p=<post_id>, at least for scheduled multi-page posts, and so the previous link becomes ?p=52248&page=2
Here is a simple patch that more or less does that change: