[wp-trac] [WordPress Trac] #55751: get_the_posts_navigation() is using incorrect functions to output navigation links
WordPress Trac
noreply at wordpress.org
Tue May 17 18:12:27 UTC 2022
#55751: get_the_posts_navigation() is using incorrect functions to output
navigation links
-------------------------------+-----------------------------
Reporter: jongycastillo | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 5.9.3
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
The filters `next_posts_link_attributes` and
`previous_posts_link_attributes` were applying to the incorrect posts
navigation links.
**Are you using either the latest version of WordPress, or the latest
development version?**
Website is using WordPress core v5.9.3.
**What steps should be taken to consistently reproduce the problem?**
I added a filter in my theme, using the filters
`next_posts_link_attributes` and `previous_posts_link_attributes`, and
they were applying to the incorrect posts navigation links. The filter
`next_posts_link_attributes` was applying to the previous nav link and
vice versa.
**In case it's relevant to the ticket, what is the expected output or
result? What did you see instead?**
On further investigation, I found the bug in `wp-includes/link-
template.php` in the function definition for `get_the_posts_navigation()`,
line 2788 and 2789, where the incorrect functions are being used for
`$next_link` and `$prev_link`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55751>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list