Skip to content

Instantly share code, notes, and snippets.

@miklb
Created April 5, 2012 15:16
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miklb/2311897 to your computer and use it in GitHub Desktop.
Save miklb/2311897 to your computer and use it in GitHub Desktop.
Add Pdf and Word Doc filtering to WordPress Media Library
/**
* add custom "mime types" (file supertypes)
* @param array $post_mime_types
* @return array
*/
function filterPostMimeTypes($post_mime_types) {
$post_mime_types['application/pdf'] = array('PDF', 'Manage PDFs', _n_noop('PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>'));
$post_mime_types['application/msword'] = array('Word Docs', 'Manage Word Docs', _n_noop('Word DOC <span class="count">(%s)</span>', 'Word Docs <span class="count">(%s)</span>'));
return $post_mime_types;
}
add_filter('post_mime_types', 'filterPostMimeTypes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment