这段代码让你添加或移除WordPress上传弹出允许的文件类型。比如添加字体文woff默认是不允许的,而下面的代码轻松的让你实现。
把以下代码加到 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');
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。