WordPress.org

Ready to get started?Download WordPress

Forums

Filter media library by file type (7 posts)

  1. pastorjim
    Member
    Posted 3 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
    Member
    Posted 3 years ago #

    +1

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

  4. Michal Mau
    Member
    Posted 3 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
    Member
    Posted 3 years ago #

    Works nicely. Thanks!!

  6. juan75
    Member
    Posted 3 years ago #

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

  7. AardvarkGirl
    Member
    Posted 3 years ago #

    Beautiful :)

Topic Closed

This topic has been closed to new replies.

About this Topic