Skip to content

Instantly share code, notes, and snippets.

View Theasker's full-sized avatar

Mauricio Segura Ariño Theasker

  • Zaragoza (Spain)
View GitHub Profile
@Theasker
Theasker / functions.php
Created May 10, 2017 11:55 — forked from miklb/functions.php
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;
}