| 2198 | | $ext2type = apply_filters( 'ext2type', array( |
| 2199 | | 'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ), |
| 2200 | | 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ), |
| 2201 | | 'video' => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ), |
| 2202 | | 'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ), |
| 2203 | | 'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb' ), |
| 2204 | | 'interactive' => array( 'swf', 'key', 'ppt', 'pptx', 'pptm', 'pps', 'ppsx', 'ppsm', 'sldx', 'sldm', 'odp' ), |
| 2205 | | 'text' => array( 'asc', 'csv', 'tsv', 'txt' ), |
| 2206 | | 'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ), |
| 2207 | | 'code' => array( 'css', 'htm', 'html', 'php', 'js' ), |
| 2208 | | ) ); |
| | 2198 | $ext2type = apply_filters( 'ext2type', wp_get_type_extensions() ); |
| | 2323 | * Retrieve a list of file types and their extensions. |
| | 2324 | * |
| | 2325 | * @since 4.6.0 |
| | 2326 | * |
| | 2327 | * @return array The array of file types as keys with their extensions in an array as value. |
| | 2328 | */ |
| | 2329 | function wp_get_type_extensions() { |
| | 2330 | /** |
| | 2331 | * Filter file types and their extensions. |
| | 2332 | * |
| | 2333 | * @since 4.6.0 |
| | 2334 | * |
| | 2335 | * @see wp_get_type_extensions() |
| | 2336 | * |
| | 2337 | * @param array $type_extensions Multi-dimensional array with extensions for a default set |
| | 2338 | * of file types. |
| | 2339 | */ |
| | 2340 | return apply_filters( 'wp_type_extensions', array( |
| | 2341 | 'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ), |
| | 2342 | 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ), |
| | 2343 | 'video' => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ), |
| | 2344 | 'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ), |
| | 2345 | 'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb' ), |
| | 2346 | 'interactive' => array( 'swf', 'key', 'ppt', 'pptx', 'pptm', 'pps', 'ppsx', 'ppsm', 'sldx', 'sldm', 'odp' ), |
| | 2347 | 'text' => array( 'asc', 'csv', 'tsv', 'txt' ), |
| | 2348 | 'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ), |
| | 2349 | 'code' => array( 'css', 'htm', 'html', 'php', 'js' ), |
| | 2350 | ) ); |
| | 2351 | } |
| | 2352 | |
| | 2353 | /** |