[wp-trac] [WordPress Trac] #45337: Strange pagination issue
WordPress Trac
noreply at wordpress.org
Thu Apr 30 12:09:45 UTC 2020
#45337: Strange pagination issue
------------------------------------------+-----------------------------
Reporter: sachit.tandukar | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Rewrite Rules | Version: 4.4
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses:
------------------------------------------+-----------------------------
Comment (by SergeyBiryukov):
Replying to [comment:1 jeremyfelt]:
> There are (at least) two ways in which this presents itself:
>
> First: when a request is made to any `is_singular()` post/page with
`/2/` appended to the URL, WordPress checks for an instance of `<!--
nextpage-->` in the content. If it exists, and it matches the page number,
`$success` is set to `true` and the page is loaded. If the next page
marker does not exist, there is no current check that flags the content
for 404 if a page number is part of the URL. For that, we could do
something like [attachment:"45337.diff"] to return a 404 if content is not
paged.
>
> Second: (highlighted in the ticket description), when a page is set as
the `page_for_posts`, `is_singular()` is false and the logic handling `<!
--nextpage-->` is skipped entirely. Earlier in the process, the query
object was populated with posts, so as far as `handle_404()` is concerned,
`is_home()` is `true` and the page can be loaded as is. The fix for this
seems a little more complicated and _could_ be handled earlier in the
process.
Thanks for the detailed comment!
[47727] should fix the first item, let's keep the ticket open for the
second item.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45337#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list