WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 weeks 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 needs-testing
Focuses: Cc:

Description

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 3 weeks ago.

Download all attachments as: .zip

Change History (4)

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


3 weeks ago

#2 @isabel_brison
3 weeks ago

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

@markparnell
3 weeks ago

#3 @markparnell
3 weeks 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.

Note: See TracTickets for help on using tickets.