Make WordPress Core

Opened 17 years ago

Closed 13 years ago

Last modified 12 years ago

#13052 closed enhancement (wontfix)

Return the URL of the next adjacent image in a gallery

Reported by: iandstewart Owned by:
Priority: normal Milestone:
Component: Media Version:
Severity: normal Keywords:
Cc: Focuses:

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 17 years ago.

Download all attachments as: .zip

Change History (7)

#1 @westi
17 years ago

  • Cc westi added

Sounds like an interesting idea.

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

#2 @iandstewart
17 years ago

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

#3 @scribu
17 years ago

What about get_previous_image_url() ?

#4 @scribu
17 years ago

  • Component General → Media
  • Milestone Unassigned → Future Release

#5 @ericlewis
13 years ago

  • Resolution → wontfix
  • Status new → closed

This isn't possible since 3.5; galleries are no more synonymous with the attachments uploaded/related to the post, and multiple galleries can exist in a post's content utilizing the the ids attribute on the [gallery] shortcode. Closing this out as wontfix.

#6 @SergeyBiryukov
12 years ago

  • Milestone Future Release

adjacent_image_link() is filterable since [23140], see #22829.

Note: See TracTickets for help on using tickets.