WordPress tip: allow upload of more file types

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!
By the way, I’m running a contest at CatsWhoBlog where you can win premium WordPress themes. Click here to join!
Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!WordPress tip: allow upload of more file types

You Might Also Like...

  • WordPress tip: Insert posts programmatically

    1585 readersDo you know that it is possible to insert post in WordPress programmatically? In this recipe, I'll show you how to do it easily.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!WordPress tip: Insert posts programmatically

  • How to display custom post types on your WordPress blog homepage

    1847 readersWordPress 3.0 will allow you to create custom post types, so what about being able to list those custom types on your blog homepage? This very useful piece of code will show you how you can do it.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for

  • How to remove “private” and “protected” from the post title

    2005 readersEach time you define a specific post as being private or password-protected, WordPress automatically add "Private" or "Protected" to your blog post title. If you don't want it, nothing simpler: Just apply this great hack.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!How to remove

  • Christmas contest: Win 3 copies of the new Sunset Farm theme

    968 readersHere at WpRecipes, we really love to provide great prizes as such as premium themes to our readers. Today, our sponsor ThemeGrade is giving away 3 copies of their new "Sunset farm" theme. Just read on, enter the contest and try to win this cool theme!Looking for WordPress hosting? Try WP Web Host. Prices starts

  • WordPress tip: Allow contributors to upload files

    1572 readersIf you have contributors to your blog, you probably got annoyed to see that they can't upload files and images while writing guest posts for you. Today's recipe will solve the problem, allowing contributors to upload files to your blog.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try

  • How to automatically remove the Nofollow from your posts

    1542 readersBy default, WordPress automatically converts all links from the post content to nofollow. If you prefer your links to be dofollow, just read and use the following recipe.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!How to automatically remove the Nofollow from your posts

  • How to remove menus in WordPress dashboard

    1626 readersHappy 2010! To start this new year with a great WP recipe, I'm going to show you how you can easily remove menus in the WordPress dashboard. This can be really useful when building a WP site for a client.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try

  • Add categories or tags to post programatically

    936 readersI recently shown you jow you can create a post or a comment programatically, which is very usefull when creating advanced WOrdPress themes or plugins. Today, let's have a look at another killer snippet: Add categories or tags to a posts, programatically.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you

  • WordPress tip : change excerpt length depending of the category

    310 readersDo you ever wished to be able to modify the excerpt length based on which category you are on, without modifying your theme files? If yes, I'm pretty sure you'll be happy with that recipe.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!WordPress tip :

  • How to Track RSS Subscribers in a Blog Contest

    232 readersLet me start off by saying that this post will not talk about how to get sponsors, how to determine prizes, or how to determine rules for a blog contest. This post will talk about how to tweak your WordPress blog to solve the biggest problem in running a blog contest to gain RSS subscribers.