Make WordPress Core

Opened 8 years ago

Last modified 5 years ago

#34853 new enhancement

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

Reported by: danrossiter's profile dan.rossiter Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: General Keywords: has-patch
Focuses: Cc:


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 8 years ago.
Proposed patch for creating wp_get_image_extensions()

Download all attachments as: .zip

Change History (2)

8 years ago

Proposed patch for creating wp_get_image_extensions()

#1 @swissspidy
8 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.