wp_check_filetype [ WordPress Function ]
wp_check_filetype ( $filename, $mimes = null )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: wp_check_filetype_and_ext, wp_cache_delete, wp_match_mime_types, wp_richedit_pre, wp_check_invalid_utf8
Retrieve the file type from the file name.
You can optionally define the mime array, if needed.
Source
<?php
function wp_check_filetype( $filename, $mimes = null ) {
if ( empty($mimes) )
$mimes = get_allowed_mime_types();
$type = false;
$ext = false;
foreach ( $mimes as $ext_preg => $mime_match ) {
$ext_preg = '!\.(' . $ext_preg . ')$!i';
if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
$type = $mime_match;
$ext = $ext_matches[1];
break;
}
}
return compact( 'ext', 'type' );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/wp check filetype « WordPress Codex
Description. Retrieve the file type from the file name. You can optionally define the mime array, if needed. Usage. <?php wp_check_filetype( $filename, $mimes ) ...
codex.wordpress.org - Amend MIME type array in function wp_check_filetype - WordPress
Amend MIME type array in function wp_check_filetype (1 post). Paul-PA Member Posted 3 years ago #. The m3u file type is widely used. I recommend adding ...
wordpress.org - wp_check_filetype (WordPress Function) - WPSeek.com
WordPress lookup for wp_check_filetype, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - PHPXRef 0.7 : WordPress : Function Reference: wp_check_filetype()
Function and Method Cross Reference. wp_check_filetype(). Defined at: /wp- includes/functions.php -> line 1658. Referenced 7 times: /wp-includes/ms-files. php ...
phpxref.ftwr.co.uk