Home / functions.php / Allow more filetype uploads
  • How to Allow more filetype uploads

    no thumbnail sorry: Allow more filetype uploads

    Adding this PHP code to your functions.php will allow you to define other file types you can upload to wordpress separating each file type by a vertical pipe.

    ( click code to copy )

    wordpress snippet : 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');
    

    ( WordPress codex functions, hooks, in this snippet. )

    upload_mimes, add_filter,