Quantcast
Viewing all articles
Browse latest Browse all 33

How to Allow Upload of More File Types in WordPress!

Image may be NSFW.
Clik here to view.
allow upload
In WordPress for some reason, WordPress uploader won’t let you upload some file types  such as Textmate’s .tmCommand. If you need to upload those files to your WordPress blog, here is a very nice snippet that will allow you to allow upload of more file types in WordPress.

Simply paste the following code on your functions.php file. If needed, you can add more file types by adding them on line 4, separated by a pipe (|).

<?php
function addUploadMimes($mimes) {
    $mimes = array_merge($mimes, array(
        'tmbundle|tmCommand|tmDragCommand|tmSnippet|tmLanguage|tmPreferences' => 'application/octet-stream'
    ));

    return $mimes;
}
?>

add_filter('upload_mimes', 'addUploadMimes');

 

Thanks to Pioupioum for this great piece of code!

The post How to Allow Upload of More File Types in WordPress! appeared first on WordPress Experts.


Viewing all articles
Browse latest Browse all 33

Trending Articles