Opened 3 years ago

Last modified 3 years ago

#13052 new enhancement

Return the URL of the next adjacent image in a gallery

Reported by: iandstewart Owned by:
Priority: normal Milestone: Future Release
Component: Media Version:
Severity: normal Keywords:
Cc: westi

Description

A function that returned the URL of the next adjacent image for an attachment in a gallery post, or the URL of the parent post if there isn't an adjacent image, would be a really useful enhancement for attachment templates.

Attached is a diff of media.php with the custom function I rolled from adjacent_image_link() to do just that.

Attachments (1)

media.diff (927 bytes) - added by iandstewart 3 years ago.

Download all attachments as: .zip

Change History (5)

  • Cc westi added

Sounds like an interesting idea.

Does this not need to be aware of the ordering of the gallery though?

That is … true. It works just like adjacent_image_link() and will only return the next adjacent attachment URL—completely ignoring the gallery ordering.

What about get_previous_image_url() ?

  • Component changed from General to Media
  • Milestone changed from Unassigned to Future Release
Note: See TracTickets for help on using tickets.