Filter media library by file type (7 posts)

  1. pastorjim
    Posted 5 years ago #

    It would be useful to filter the media library by file type. The search feature does not seem to do this. For example, I have jpg, gif, and pdf files and would like to just see the pdf files.

  2. Rami Yushuvaev
    Posted 5 years ago #


  3. It sorts them by mime type but it looks like .pdf is considered an image. Well that's interesting!

  4. Michal Mau
    Posted 5 years ago #

    You can add this piece of puzzle into your theme's function.php file:

    function modify_post_mime_types($post_mime_types) {
        $post_mime_types['application/pdf'] = array(__('PDF'), __('Manage PDF'), _n_noop('PDF <span class="count">(%s)</span>', 'PDF <span class="count">(%s)</span>'));
        return $post_mime_types;
    add_filter('post_mime_types', 'modify_post_mime_types');

    Works for me.

  5. pastorjim
    Posted 5 years ago #

    Works nicely. Thanks!!

  6. juan75
    Posted 5 years ago #

    it's possible to group mime types in one tab? i tried in several ways without success!

  7. AardvarkGirl
    Posted 4 years ago #

    Beautiful :)

Topic Closed

This topic has been closed to new replies.

About this Topic