wp_ext2type [ WordPress Function ]
wp_ext2type ( $ext )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Retrieve the file type based on the extension name.
Source
<?php
function wp_ext2type( $ext ) {
$ext2type = apply_filters( 'ext2type', array(
'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
'video' => array( 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ),
'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'rtf', 'wp', 'wpd' ),
'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsb', 'xlsm' ),
'interactive' => array( 'key', 'ppt', 'pptx', 'pptm', 'odp', 'swf' ),
'text' => array( 'asc', 'csv', 'tsv', 'txt' ),
'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ),
'code' => array( 'css', 'htm', 'html', 'php', 'js' ),
));
foreach ( $ext2type as $type => $exts )
if ( in_array( $ext, $exts ) )
return $type;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- How To Upload Flash F4v Video With WordPress
Dec 1, 2010 ... function wp_ext2type; function get_allowed_mime_types. The proper method for adding this Mime type would be to add via a Plugin so that any ...
www.redbridgenet.com - PHPXref.com - WordPress 3.0.1 - Function Reference: wp_ext2type()
Aug 19, 2010 ... PHPXref.com - WordPress 3.0.1 - Function Reference: wp_ext2type()
phpxref.com - WordPress › Support » File type does not meet security guidelines
New extensions and their icons can be added via changes to the functions wp_check_filetype and wp_ext2type in wp-includes/functions.php." Seriously?
wordpress.org - WordPressで.flvの拡張子を登録しないとエラーが表示される | 2BLOG
2009年3月30日 ... function wp_ext2type( $ext ) { $ext2type = apply_filters('ext2type', array( ... wp_ext2typeは、拡張子に対して表示されるアイコンを登録しているので ...
blog.nipx.jp