WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#17302 closed enhancement (fixed)

Add get_previous_post_link(), get_next_post_link(), and get_adjacent_post_link()

Reported by: yoavf Owned by: westi
Milestone: 3.7 Priority: normal
Severity: normal Version: 3.1
Component: Template Keywords: has-patch
Focuses: Cc:

Description

Unlike many other template tags, he functions adjacent_post_link(), next_post_link(), and previous_post_link() are missing their get_ counterparts.
Included patch adds those.

Attachments (6)

get_adjacent_post_link.diff (4.3 KB) - added by yoavf 6 years ago.
17302.1.diff (4.4 KB) - added by johnpbloch 6 years ago.
Refreshed on trunk
17302.2.diff (5.5 KB) - added by markjaquith 6 years ago.
return instead of echo in the get function
17302.3.diff (5.1 KB) - added by SergeyBiryukov 5 years ago.
17302.4.diff (5.1 KB) - added by yoavf 4 years ago.
refreshed for 3.7
17302.diff (5.1 KB) - added by wonderboymusic 4 years ago.

Download all attachments as: .zip

Change History (24)

#1 @westi
6 years ago

  • Milestone changed from Awaiting Review to 3.2
  • Owner set to westi
  • Status changed from new to reviewing

#2 @jane
6 years ago

  • Milestone changed from 3.2 to Future Release

Missed feature freeze, consider in 3.3.

#3 @SergeyBiryukov
6 years ago

  • Keywords needs-refresh added
  • Milestone changed from Future Release to 3.3

@johnpbloch
6 years ago

Refreshed on trunk

#4 @johnpbloch
6 years ago

  • Keywords needs-refresh removed

@markjaquith
6 years ago

return instead of echo in the get function

#5 @ryan
6 years ago

  • Milestone changed from 3.3 to Future Release

Punting enhancements from 3.3

#6 @ocean90
6 years ago

Duplicate: #19652

#7 @ocean90
6 years ago

For get_adjacent_post_link() #13489

#8 @ryanduff
6 years ago

  • Cc ryan@… added

Any reason we can't get this in for 3.4 before freeze? Don't really see any issues with it.

#9 @nacin
6 years ago

  • Milestone changed from Future Release to 3.4

OK here. Jaquith?

#10 @markjaquith
6 years ago

  • Keywords needs-refresh added; has-patch removed
  • Milestone changed from 3.4 to Future Release

Needs a refresh.

#11 @sscovil
5 years ago

Any idea when this will be added? As a theme developer, I think it's pretty important...

#12 @SergeyBiryukov
5 years ago

  • Keywords has-patch added; needs-refresh removed

#14 @pauldewouters
5 years ago

  • Cc pauldewouters@… added

#15 @yoavf
4 years ago

  • Keywords needs-refresh added

@yoavf
4 years ago

refreshed for 3.7

#16 @yoavf
4 years ago

  • Keywords needs-refresh removed
  • Milestone changed from Future Release to 3.7
  • Version 3.2 deleted

#17 @DrewAPicture
4 years ago

  • Version set to 3.1

The enhancement was suggested in 3.1.

@wonderboymusic
4 years ago

#18 @wonderboymusic
4 years ago

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

In 25327:

Introduce get_previous_post_link(), get_next_post_link(), and get_adjacent_post_link(). Allows developers to retrieve the value without echoing.

Props yoavf, markjaquith, SergeyBiryukov.
Fixes #17302.

Note: See TracTickets for help on using tickets.