WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 22 months ago

#32618 closed enhancement (fixed)

Additional args for get_the_post_navigation()

Reported by: ChaseWiseman Owned by: DrewAPicture
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.3
Component: Themes Keywords: has-patch
Focuses: template Cc:

Description

It would be awesome if get_the_post_navigation() accepted and passed along all of the parameters available to the get_next_post_link() and get_previous_post_link() functions that are used within. This would allow developers to still use the function in cases where limiting navigation by taxonomy/term is desired. Namely $in_same_term, $excluded_terms, and $taxonomy.

This was first mentioned in https://github.com/Automattic/_s/issues/759

Attachments (2)

32618.diff (2.4 KB) - added by ChaseWiseman 2 years ago.
32618.2.diff (2.6 KB) - added by DrewAPicture 22 months ago.
Docs fixes + spacing

Download all attachments as: .zip

Change History (7)

@ChaseWiseman
2 years ago

#1 @ChaseWiseman
2 years ago

  • Keywords has-patch added

#2 @obenland
2 years ago

  • Milestone changed from Awaiting Review to Future Release

Let's tackle the completion of that API in 4.4.

#3 @wonderboymusic
22 months ago

  • Milestone changed from Future Release to 4.4
  • Owner set to DrewAPicture
  • Status changed from new to assigned

check out the docs

#4 @DrewAPicture
22 months ago

  • Status changed from assigned to accepted

@DrewAPicture
22 months ago

Docs fixes + spacing

#5 @DrewAPicture
22 months ago

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

In 34715:

Themes: Introduce three new arguments for get_the_post_navigation(), in_same_term, excluded_terms, and taxonomy.

The addition of these new arguments brings get_the_post_navigation() into argument parity with get_previous_post_link() and get_next_post_link(), both of which it wraps, and will allow for more flexibility in configuring the next and previous post links for simultaneous display in themes.

Props ChaseWiseman.
Fixes #32618.

Note: See TracTickets for help on using tickets.