wordpress修改上传文件默认类型

把以下代码加到 functions.php 文件中

function edit_upload_types($existing_mimes = array()) {
    // allow .woff
    $existing_mimes['woff'] = 'font/woff';
 
    // add as many as you want with the same syntax
 
    // disallow .jpg files
    unset( $existing_mimes['jpg'] );
 
    return $existing_mimes;
}
add_filter('upload_mimes', 'edit_upload_types');

发布日期:

所属分类: Wordpress 综合 标签: