Advertisement
iEmanuele

Estensione mime_types validi

Mar 16th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. /*
  2.     ttf   as "application/x-font-ttf" or "application/x-font-truetype"
  3.     otf   as "application/x-font-opentype"
  4.     woff  as "application/font-woff"
  5.     woff2 as "application/font-woff2" (proposed by W3C)
  6.     eot   as "application/vnd.ms-fontobject"
  7. */
  8. add_filter('upload_mimes', 'sator_mime_types', 10);
  9. function sator_mime_types($mime_types){
  10.     $mime_types['ttf'] = "application/x-font-ttf";
  11.     $mime_types['otf'] = "application/x-font-opentype";
  12.     $mime_types['woff'] = "application/font-woff";
  13.     $mime_types['woff2'] = "application/font-woff2";
  14.     $mime_types['eot'] = "application/vnd.ms-fontobject";
  15.  
  16.     return $mime_types;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement