[wp-trac] [WordPress Trac] #55751: get_the_posts_navigation() is using incorrect functions to output navigation links
WordPress Trac
noreply at wordpress.org
Tue Jun 7 09:18:04 UTC 2022
#55751: get_the_posts_navigation() is using incorrect functions to output
navigation links
--------------------------------------+------------------------------
Reporter: jongycastillo | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 5.9.3
Severity: normal | Resolution: invalid
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+------------------------------
Changes (by geisthanen):
* status: new => closed
* resolution: => invalid
Comment:
The current functionality of {{{ get_posts_navigation}}} is correct. I
think the main confusion comes from effect the default descending order
has when querying posts.
As mentioned in the documentation:
[https://developer.wordpress.org/reference/functions/get_next_posts_link/]
Because post queries are usually sorted in reverse chronological order,
{{{get_next_posts_link()}}} usually points to older entries (toward the
end of the set) and
{{{get_previous_posts_link()}}} usually points to newer entries (toward
the beginning of the set).
I've created a collection of tests that proves that the current
functionality is correct and can be seen here:
https://github.com/WordPress/wordpress-develop/pull/2792
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55751#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list