WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#35211 closed defect (bug) (fixed)

excluded_terms filter in `get_adjacent_link()` doesn't do anything

Reported by: boonebgorges Owned by: boonebgorges
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:
PR Number:

Description

The get_{$adjacent}_post_excluded_terms filter, added in [34528], doesn't do anything. It runs after the excluded terms have been added to the SQL clause.

Solution is to move it further up in the function.

See #9571.

Attachments (1)

35211.diff (429 bytes) - added by netweb 4 years ago.

Download all attachments as: .zip

Change History (5)

#1 @boonebgorges
4 years ago

In 36077:

Move get_adjacent_post() tests to their own file.

See #35211.

#2 @boonebgorges
4 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 36078:

Move excluded_terms filter in get_adjacent_post().

The filter was added in 4.4 [34528] #9571, but in a place where it could not
affect the adjacent post query.

Fixes #35211.

@netweb
4 years ago

#3 @netweb
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The @covers annotation added in [36077] references a non-existent function get_adjacent_link(), it should reference get_adjacent_post() as such 35211.diff changes this to @covers ::get_adjacent_post

#4 @boonebgorges
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 36159:

Fix incorrect @covers annotation in get_adjacent_post() tests.

Introduced in [36077].

Props netweb.
Fixes #35211.

Note: See TracTickets for help on using tickets.