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

WordPress Trac noreply at wordpress.org
Fri Jan 4 22:12:07 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 dev-feedback  |     Focuses:
------------------------------------+-----------------------

Comment (by pbiron):

 Replying to [comment:19 mikeschroder]:
 > I noticed that in the patch, in `src/wp-includes/customize/class-wp-
 customize-media-control.php:89`, it looks like `bmp` was in the extension
 list before the patch and isn't anymore after the patch. Is that
 intentional, and if so, could you please walk me through the reasoning?

 No, not intentional.  I hadn't noticed that that particular extension list
 included something that wasn't in the default list...thanx for catching
 that.  Looking over the rest of the patch, that is the only list that
 includes something not in the default list.  Note, however, that the
 default list does include 'jpe', which is **not** in the original lists in
 a couple of other places.

 BTW: the "default" list comes from what was previously in the
 `switch/case` statement in `src/wp-includes/post.php`.

 Which raises 2 questions:

 * why isn't 'bmp' in the default list?
 * why is 'bmp' included in that one (and no where else)?

 I don't know the answer to either of those questions.

 If there is good reason for 'bmp' not to be included in the default list
 and good reason for it to be included in that particular list, then I
 think the best thing to do is to bracket that line with `add_filter(
 'wp_image_extensions', ... )` and `remove_filter( 'wp_image_extensions',
 ... )` with a function that will add 'bmp' to that list.

 If 'bmp' can/should be added to the default list, then I'll update the
 hooked func in the unit test to add some other image extension.

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


More information about the wp-trac mailing list