More Sorting Options for the Media Library

If you work with a lot of PDFs in WordPress, you may find the lack of a “view PDFs” link annoying, especially considering that you can separate image and audio attachments easily.

Fortunately, you can fix that.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: