WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20230 closed enhancement (duplicate)

Add new filter post_gallery_results to replace the core gallery template after the attachment query

Reported by: jeremyfelt Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch
Focuses: Cc:

Description

The post_gallery filter in gallery_shortcode() already allows complete replacement of the gallery template provided by core. However, any function attached to this filter must also handle the query logic for attachment data.

The proposed filter post_gallery_results is placed immediately after all query logic is complete. The gallery template output can still be replaced, but with the help of the $attachments data provided by core queries.

Attachments (1)

20230.diff (514 bytes) - added by jeremyfelt 2 years ago.
Additional filter for post_gallery_results in media.php

Download all attachments as: .zip

Change History (4)

jeremyfelt2 years ago

Additional filter for post_gallery_results in media.php

comment:1 TomAuger2 years ago

Looks like an exact duplicate of #14130, except that he's putting the filter after the feed() check, instead of before.

However, I prefer #14130 because it also includes the $attr parameter, which is pretty critical if you're going to be rolling your own HTML output.

comment:2 TomAuger2 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

comment:3 ocean902 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.