Make WordPress Core

Opened 6 years ago

Last modified 19 months ago

#34638 new feature request

New function for retrieving previous and next adjacent image

Reported by: solidcolour Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.4
Component: Media Keywords: has-patch
Focuses: Cc:


There are previous_image_link() and next_image_link() functions. But there are no functions that only return true and false, which would works similarly to get_previous_post() and get_next_post() but for images. It would be very helpful to have that, so we can easily to control whether to output the pagination HTML markup in image.php.

Attachments (1)

34638.diff (4.4 KB) - added by markparnell 21 months ago.

Download all attachments as: .zip

Change History (5)

This ticket was mentioned in Slack in #core by noisysocks. View the logs.

21 months ago

#2 @isabel_brison
21 months ago

  • Component changed from General to Media
  • Keywords needs-patch added
  • Milestone set to Future Release

21 months ago

#3 @markparnell
21 months ago

  • Keywords has-patch needs-testing added; needs-patch removed

Patch adds get_previous_image_link(), get_next_image_link() and get_adjacent_image_link() which return the link instead of echoing it.

#4 @markparnell
19 months ago

  • Keywords needs-testing removed
Note: See TracTickets for help on using tickets.