Custom mime types in Wordpress


/ Published in: PHP
Save to your folder(s)

This code allows the upload of files with extensions usually forbidden in wordpress


Copy this code and paste it in your HTML
  1. <?php
  2. add_filter('upload_mimes','customprefix_upload_mimes');
  3. function customprefix_upload_mimes($mimes){
  4. return array_merge($mimes,array (
  5. 'ac3' => 'audio/ac3',
  6. 'mpa' => 'audio/MPA',
  7. 'flv' => 'video/x-flv'
  8. ));
  9. }
  10. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.