[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):

 [[https://core.trac.wordpress.org/attachment/ticket/41801/41801.3.diff|41801.3.diff]]
 contains the following changes from
 [[https://core.trac.wordpress.org/attachment/ticket/41801/41801.2.diff|41801.2.diff]]

 * updates `@since` tag to 5.1.0 (in `wp_get_image_extensions()`)
 * fixes the typo mentioned in
 https://core.trac.wordpress.org/ticket/41801#comment:11
 * removes the hardcoded image extensions from `$misc_ext` in
 `populate_network_meta()
     * note: previous patch and comments on this ticket had those changes
 in `populate_network()`, but a subsequent commit moved that code to
 `populate_network_meta()`
 * 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
 https://wordpress.slack.com/archives/C02SX62S6/p1536269781000100
     * `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
 committing.

 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