【发布时间】:2019-01-04 08:16:52
【问题描述】:
【问题讨论】:
【问题讨论】:
试试这个功能
function webp_upload_mimes( $existing_mimes ) {
// add webp to the list of mime types
$existing_mimes['webp'] = 'image/webp';
// return the array back to the function with our added mime type
return $existing_mimes;
}
add_filter( 'mime_types', 'webp_upload_mimes' );
【讨论】:
您需要在上传时添加mime类型,您可以使用以下功能实现。
add_filter( 'mime_types', 'webp_upload_mimes' );
function webp_file_upload( $mimes )
{
$mimes['webp'] = 'image/webp'; // add webp in mime type
return $mimes; // return the mime types
}
希望这对你有用
【讨论】: