您使用upload_mimes 筛选以将图像类型限制为:
add_filter(\'upload_mimes\',\'restict_image_type\');
function restict_image_type($mimes) {
$mimes = array(
\'jpg|jpeg|jpe\' => \'image/jpeg\',
\'gif\' => \'image/gif\',
\'png\' => \'image/png\',
);
return $mimes;
}
对于上载限制,您可以在中设置。htaccess以下选项之一;
LimitRequestBody 1048576 //( 1MB)
php_value upload_max_filesize 1M
php_value post_max_size 1M