-
-
Save Theasker/93e110234b18b3adffadded48215df8e to your computer and use it in GitHub Desktop.
Add Pdf and Word Doc filtering to WordPress Media Library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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