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

WordPress Trac noreply at wordpress.org
Tue Mar 19 10:43:34 UTC 2019


#38195: Adding more mime_types filter to Media Library
-------------------------------------------------+-------------------------
 Reporter:  zodiac1978                           |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback has-          |     Focuses:
  screenshots ui-feedback                        |
-------------------------------------------------+-------------------------

Comment (by zodiac1978):

 I'm a little bit disappointed about the lack of ''specific'' feedback.
 Like I already mentioned these entries would just show up if there are
 files with these mime types uploaded.

 I have tried to categorize **all** mime types for which uploading is
 allowed. Maybe it would have been better to wait for the discussion about
 these categories. Or I should have made a suggestion about just the useful
 categories, but I thought I should solve the bigger picture. Maybe I was
 wrong.

 In the description of the ticket I made a first suggestion about this
 grouping.

 These are the allowed mime types:
 https://github.com/WordPress/WordPress/blob/master/wp-
 includes/functions.php#L2710-L2810

 Images, Audio and Video is the status quo of the grouping:
 https://github.com/WordPress/WordPress/blob/71cf332e6569f0ac2f263ce9b2168644942f5534
 /wp-includes/post.php#L2626-L2641

 I am not sure if the categories used in the `wp_get_mime_types` inline
 docs are a good idea:
 **Image formats, Video formats, Text formats, Audio formats, Misc
 application formats, MS Office formats, OpenOffice formats, WordPerfect
 formats, iWork formats**

 Maybe the groups used in the `wp_get_ext_types` are better:
 https://github.com/WordPress/WordPress/blob/master/wp-
 includes/functions.php#L2837-L2845

 These would be:
 **image, audio, video, document, spreadsheet, interactive, text, archive,
 code**

 The first three are already used. We could add `Documents`. This seems to
 be widely accepted in the Slack. More questions / notices from Slack:


 Interesting idea from @mikeschroder :
 > I think more around making it easy to sort by them in the media modal

 Sorting would be great too. My use case is: I have uploaded a PDF and want
 to find it. I could search for ".pdf", but maybe using the dropdown is
 faster and more easy.

 Issue mentioned from @karmatosed :
 > To me that list will only continue to grow.

 I don't think, because this would handle all allowed mime types and if
 more mime types are added  they could be added to one of the existing
 groups (like the the ebook mime types mentioned above) which could be
 added to `Documents`.

 And another question from @karmatosed :
 > Do we know any examples that have solved this?

 Yes, there are some plugins:

 The most notable ones are these I think:
 https://wordpress.org/plugins/media-library-assistant/ (adds `Text` and
 `Applications` which seems to be quite confusing)
 and
 https://wordpress.org/plugins/enhanced-media-library/ (adds `Documents`
 and `PDFs`)

 Most of the other plugins are just adding specific mime types and are not
 setting these groups.

 Like https://wordpress.org/plugins/mime-types-plus/ - but this is using
 the same grouping as `wp_get_ext_types` on their settings screen.

 Some plugins are adding specific new groups for their use case (like
 Favicon Images, PDFs, Avatar Images, CSV for products, XML, GPX data,
 etc.)

 All plugins using the filter can be found here:
 https://wpdirectory.net/search/01D6AMX61FZ37RF534Z7BVS0B0

 This search is even more helpful to get faster access to the added groups:
 https://wpdirectory.net/search/01D6AQMY05PKKSFJP6HCW22127

 Most plugins are adding PDFs. Or newly added extensions, but I found some
 plugins which have added ''more'' groups, like this ticket is suggesting.

 https://wordpress.org/plugins/media-filter/
 https://wordpress.org/plugins/wp-media-manager-lite/
 https://wordpress.org/plugins/wp-admin-ui/
 https://wordpress.org/plugins/media-library-shortcode/

 All of theme using some variation sets of Archives/ZIPs/RARs/TARs,
 Documents/Docs, Office, OpenOffice, Excel, PDFs, etc. - But I think we
 should use generic naming and not something app/company specific, like MS
 Office or OpenOffice.

 An one more issue from @karmatosed :
 > web-document to me just feels weird wording too.

 This was my first suggestion. This could be "Text" or "Code" (belongs to
 the actual mime type). But I'm fine with adding just one or some few of
 them. For my use case `Documents` would be totally sufficient. `Archives`
 could be helpful too. I haven't uploaded any HTML or CSS file to media ...
 And `Text`, `Spreadsheets` and `Interactives` could be added to
 `Documents` too. Then we would have:
 **Images, Audio, Video, Documents, Archives**

 And one last from @karmatosed :
 > I’ll add my voice to ticket as I feel just get documents in then iterate
 is a win.

 Maybe this is a language problem (I'm not a native English speaker), but I
 doesn't felt encouraged to to do so after the last comment. Re-thinking
 the UI looked like something which has to be done before this ticket can
 go further, so I stopped working it. But there was no discussion about re-
 thinking the UI ...

 But maybe this research helps us to move further now. Any feedback is much
 appreciated.

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


More information about the wp-trac mailing list