WordPress.org

Make WordPress Core

#24309 closed enhancement (fixed)

Add filters for get_post_galleries() and get_post_gallery()

Reported by: alexkingorg Owned by: nacin
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.6
Component: Gallery Keywords: has-patch needs-refresh
Focuses: Cc:

Description

As post format implementations were not tightly defined in the past, there are a variety of gallery implementations in the wild. For example, not all implementations included the use of the [gallery] shortcode.

Adding in a couple of hooks will likely allow for backward compatibility to those implementations.

Attachments (1)

gallery-filters.diff (1.2 KB) - added by alexkingorg 14 months ago.
add filters to Gallery post format functions

Download all attachments as: .zip

Change History (8)

alexkingorg14 months ago

add filters to Gallery post format functions

comment:1 SergeyBiryukov14 months ago

  • Milestone changed from Awaiting Review to 3.6

comment:2 DrewAPicture12 months ago

  • Keywords needs-refresh added

comment:3 ocean9012 months ago

  • Type changed from defect (bug) to enhancement

comment:4 nacin12 months ago

As said in IRC:

  • as long as passed args make sense, good for commit from me.
  • but: it does make me ask why get_post_gallery() does not call get_post_galleries().
  • if there is a filter in the latter, then the former really needs to wrap the latter.

Going to look at this in concert with #24202 and a general audit of these functions.

comment:5 alexkingorg12 months ago

:does a happy little dance:

comment:6 helen12 months ago

Also, that get_content_galleries() only takes 3 args.

comment:7 nacin12 months ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 24682:

Simplify and reduce the new media/content extraction functions.

The URL extraction function is now get_url_in_content(). For more, see #24202.

Also adds filters to get_post_galleries() and get_post_gallery(). fixes #24309.

Note: See TracTickets for help on using tickets.