WordPress.org

Make WordPress Core

Opened 20 months ago

Last modified 19 months ago

#43689 new defect (bug)

next_post_link()/previous_post_link() broken for custom post types in same custom taxonomy term

Reported by: Blackbam Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.5
Component: Posts, Post Types Keywords: reporter-feedback
Focuses: Cc:
PR Number:

Description

The link to the next post is being displayed however the third parameter $in_same_term seems to be completely ignored even though parameter $taxonomy is correct (https://codex.wordpress.org/Function_Reference/next_post_link).

E.g. you are on singular pages of a custom post type "Job". You want to have the next post link of "Jobs" which are in the same "Job Group" (a custom taxonomy) e.g. "Developer". However next post link will deliver a next Job which is in the "Job Group" "Graphic Designer" even though $in_same_term was set to true.

Attachments (1)

43689.test.diff (1.7 KB) - added by soulseekah 20 months ago.
test scenario

Download all attachments as: .zip

Change History (3)

@soulseekah
20 months ago

test scenario

#1 @soulseekah
20 months ago

  • Keywords reporter-feedback added

Hey there :)

43689.test.diff is a test scenario closely resembling your description, I think. The test passes with flying colors. i.e. worksforme

What am I missing?

#2 @SergeyBiryukov
19 months ago

  • Component changed from General to Posts, Post Types
Note: See TracTickets for help on using tickets.