Posted By

scienzedellevanghe on 05/27/12


Tagged

wordpress type upload mime


Versions (?)

Custom mime types in Wordpress


 / Published in: PHP
 

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

  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  

You need to login to post a comment.