Make WordPress Core


Ignore:
Timestamp:
02/29/2008 06:54:15 AM (18 years ago)
Author:
ryan
Message:

Media Library updates from andy. see #5911

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r7063 r7100  
    11761176}
    11771177
     1178function wp_ext2type( $ext ) {
     1179    $ext2type = apply_filters('ext2type', array(
     1180        'audio' => array('aac','ac3','aif','aiff','mp1','mp2','mp3','m3a','m4a','m4b','ogg','ram','wav','wma'),
     1181        'video' => array('asf','avi','divx','dv','mov','mpg','mpeg','mp4','mpv','ogm','qt','rm','vob','wmv'),
     1182        'document' => array('doc','pages','odt','rtf','pdf'),
     1183        'spreadsheet' => array('xls','numbers','ods'),
     1184        'interactive' => array('ppt','key','odp','swf'),
     1185        'text' => array('txt'),
     1186        'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'),
     1187        'code' => array('css','html','php','js'),       
     1188    ));
     1189    foreach ( $ext2type as $type => $exts )
     1190        if ( in_array($ext, $exts) )
     1191            return $type;
     1192}
    11781193
    11791194function wp_check_filetype( $filename, $mimes = null ) {
Note: See TracChangeset for help on using the changeset viewer.