WordPress似乎没有任何地方可以更改这些设置,除了您在DB中所做的之外。但是你试过使用这个代码吗?
<?php
add_filter(\'upload_mimes\', \'custom_upload_mimes\');
function custom_upload_mimes ( $existing_mimes = array() ) {
// add your extension to the array
$existing_mimes[\'ppt\'] = \'application/vnd.ms-powerpoint\';
// or: $existing_mimes[\'ppt|pot|pps\'] = \'application/vnd.ms-powerpoint\';
// to add multiple extensions for the same mime type
// add as many as you like
// removing existing file types
unset( $existing_mimes[\'exe\'] );
// add as many as you like
// and return the new full result
return $existing_mimes;
}
?>
在主题函数文件中使用该代码。过滤器
upload_mimes
显然,您可以设置其他允许的上载扩展,还可以正确设置在WP中使用的扩展mime类型。另外,这样做的好处是升级安全。
如果需要mime类型列表:http://www.w3schools.com/media/media_mimeref.asp