WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#34853 new enhancement

A helper method should be created to centralize which extensions are used for images.

Reported by: dan.rossiter Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.4
Component: General Keywords: has-patch
Focuses: Cc:

Description

In keeping with the helper methods introduced in 3.6 for audio/media extensions retrieval, the retrieval of image extensions should similarly be wrapped in a filterable method. Currently all places where this information is needed appear to simply define their own array and use that -- very un-DRY.

Attachments (1)

add-get-img-method.patch (2.8 KB) - added by dan.rossiter 2 years ago.
Proposed patch for creating wp_get_image_extensions()

Download all attachments as: .zip

Change History (2)

@dan.rossiter
2 years ago

Proposed patch for creating wp_get_image_extensions()

#1 @swissspidy
2 years ago

  • Keywords has-patch added

FYI there's a typo in the filter DocBlock: An array of support audio formats.. It should be image formats.

Note: See TracTickets for help on using tickets.