[wp-trac] [WordPress Trac] #41801: add wp_get_image_extensions() and wp_image_extensions filter

WordPress Trac noreply at wordpress.org
Fri Jan 4 17:15:48 UTC 2019

#41801: add wp_get_image_extensions() and wp_image_extensions filter
 Reporter:  pbiron       |       Owner:  pbiron
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  5.1
Component:  Media        |     Version:  4.9
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:

Comment (by pbiron):

 contains the following changes from

 * updates `@since` tag to 5.1.0 (in `wp_get_image_extensions()`)
 * fixes the typo mentioned in
 * removes the hardcoded image extensions from `$misc_ext` in
     * note: previous patch and comments on this ticket had those changes
 in `populate_network()`, but a subsequent commit moved that code to
 * replaces additional hardcoded array of extensions with call to
 `wp_get_image_extensions()` in the following:
     * `translate_smiley()`
         * per https://core.trac.wordpress.org/ticket/41801#comment:11
     * `check_upload_mimes()`
         * per
     * `WP_Customize_Media_Control::to_json()`
     * in `wp-admin/network/settings.php`
         * to go along with the change in `check_upload_mimes()`

 There are still 2 places in core that have hardcoded lists of image
 extensions, that I think should remain so:

 * `WP_Theme::get_screenshot()`
     * the extensions for supported formats for theme screenshots.  Don't
 think it is a good idea to open this up to "arbitrary" image formats
 * `wp_get_ext_types()`

 Note: I'm currently having problems running unit tests locally (50+ tests
 are failing even before applying this patch...although no additional tests
 fail after it is applied), so it should be checked carefully before

 Hopefully this can land in 5.1.0 beta.

Ticket URL: <https://core.trac.wordpress.org/ticket/41801#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list