My Documents Shortcode plugin lets you display uploaded attachments. WordPress limits what kinds of files you can upload, but you might need to upload additional types of files. Here’s an example of how to add new file types to the ones that WordPress will allow. In my case, I needed to upload a Keynote slideshow, which had the file extension .key:
In 3.5 and beyond, I’d put that on the “mime_types” filter instead of “upload_mimes”, simply because that will ensure the custom mime types are returned by anything calling wp_get_mime_types().
Also, note that in Multisite setups, even adding the mime type is not enough, the multisite has to be configured to allow the upload of the given extension in the Network settings pages.
I’ve incorporated that change into the Gist.
Thanks for the tip. I’ll keep that in mind when I start working on the next version. Eventually, I’d like to add a settings page to give some control to the user. Also want to get additional file type icons added, with multiple sizes, and in a sprite.
Thanks for this post; I think it is exactly what I need, but I’m having trouble making it work. My theme options have a place to insert custom scripts, so I put your code in the area that said it would embed in header.php. But I think this must be wrong, because I still get a security error when trying to upload a Keynote. Where should I add the code?