函数原型
check_upload_mimes( array $mimes ): array
函数描述
Checks an array of MIME types against a list of allowed types.
是否弃用
未弃用
函数参数
-
$mimes
array
Required
函数返回值
array
函数位置
File: wp-includes/ms-functions.php.
函数源码
function check_upload_mimes( $mimes ) {
$site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) );
$site_mimes = array();
foreach ( $site_exts as $ext ) {
foreach ( $mimes as $ext_pattern => $mime ) {
if ( '' !== $ext && false !== strpos( $ext_pattern, $ext ) ) {
$site_mimes[ $ext_pattern ] = $mime;
}
}
}
return $site_mimes;
}
源码链接
变更日志
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |

