WordPress function to upload different type of media files







Here is the solution for how to upload diffrent type of media files without the plugin. Copy the function below and Paste it in the function.php file in your theme.

<?php

function diffrentfiletype($filetypes) {
   $filetypes = array_merge($filetypes, array(
       ‘tmDragCommand|tmbundle|tmCommand|tmPreferences|tmSnippet|tmLanguage|otf|ttf’ => ‘application/octet-stream’
   ));

   return $filetypes;
}

add_filter(‘upload_mimes’, ‘diffrentfiletype’);
?>

I hope it’ll helpful for you.

Share With Friends

Also Read   Display the list of subcategories of a category in Wordpress

Speak Your Mind

*

Time limit is exhausted. Please reload CAPTCHA.