[wp-trac] [WordPress Trac] #38195: Adding more mime_types filter to Media Library

WordPress Trac noreply at wordpress.org
Wed Jun 26 17:19:15 UTC 2019


#38195: Adding more mime_types filter to Media Library
-------------------------------------------------+-------------------------
 Reporter:  zodiac1978                           |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.3
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-screenshots ui-        |     Focuses:
  feedback commit                                |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch dev-feedback has-screenshots ui-feedback => has-
     patch has-screenshots ui-feedback commit
 * milestone:  Future Release => 5.3


Comment:

 I like the idea of extending the MIME types filter in Media Library! I
 don't like duplicating MIME types and maintaining them in several places
 though. I think we could reuse the existing
 [https://developer.wordpress.org/reference/functions/wp_get_ext_types/
 wp_get_ext_types()] and
 [https://developer.wordpress.org/reference/functions/wp_get_mime_types/
 wp_get_mime_types()] functions for this. The former supplies a list of
 extensions per group (`document`, `spreadsheet`, etc.), and the latter
 returns the list of supported MIME types.

 It seems like there's a consensus to add the "Documents" group, let's do
 that as a first step and then evaluate if any other groups are needed. See
 [attachment:"38195.3.diff"].

 Replying to [comment:10 zodiac1978]:
 > It is worth mentioning that these new entries just show up if you upload
 files with these mime types.

 FWIW, I could not reproduce this part. In my testing, the Documents group
 shows up even if there are no documents uploaded yet. I also haven't found
 any code for displaying the list items conditionally based on previously
 uploaded files. Still, I think it should be fine to proceed with
 [attachment:"38195.3.diff"].

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


More information about the wp-trac mailing list