Make WordPress Core

Opened 13 months ago

Last modified 13 months ago

#59241 new defect (bug)

get_the_posts_navigation wrong functions called for prev and next links

Reported by: valentinwebdev2019's profile valentinwebdev2019 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3.1
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

wp-includes\link-template.php:2858
get_the_posts_navigation function

For next link called get_previous_posts_link functions and for previous link called get_next_posts_link function

$next_link = get_previous_posts_link( $argsnext_text? );
$prev_link = get_next_posts_link( $argsprev_text? );

Change History (3)

This ticket was mentioned in PR #5113 on WordPress/wordpress-develop by ValentinLipai.


13 months ago
#1

  • Keywords has-patch added; needs-patch removed

#2 follow-up: @SergeyBiryukov
13 months ago

Hi there, welcome to WordPress Trac! Thanks for the ticket.

This was previously discussed in #55751, and some unit tests were added in [55429] and [55442]. It appears that the existing code is correct, as those tests fail with the changes from this PR.

#3 in reply to: ↑ 2 @valentinwebdev2019
13 months ago

Replying to SergeyBiryukov:

Hi there, welcome to WordPress Trac! Thanks for the ticket.

This was previously discussed in #55751, and some unit tests were added in [55429] and [55442]. It appears that the existing code is correct, as those tests fail with the changes from this PR.

Hello,
Thank you for taking the time to review my ticket.

I think that initially the problem was caused by the desire to bind the work of the function to the context.
The function actually outputs the links to switch the page number, and the context should be given by the name of the links and not by the function implementation.

It seems to me that my last changes will help to eliminate confusion, at least in the code.
Tests pass successfully

Note: See TracTickets for help on using tickets.