WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#19652 closed enhancement (duplicate)

There should be a get_next_post_link() and get_previous_post_link()

Reported by: Master Jake Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

You can do this with the plural form: get_next_posts_link() and get_previous_posts_link() so there might as well be a getter for singular posts. I often find I need to easily check for a previous or next post anyway before outputting something, and this would be the simplest way of doing that.

Attachments (1)

19652-patch.diff (2.8 KB) - added by Master Jake 2 years ago.

Download all attachments as: .zip

Change History (5)

Master Jake2 years ago

comment:1 Master Jake2 years ago

Perfect backwards compatibility maintained with previous_post_link, next_post_link, and adjacent_post_link!

comment:2 Master Jake2 years ago

  • Cc chappellind@… added

comment:3 SergeyBiryukov2 years ago

  • Keywords has-patch added

comment:4 ocean902 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.