给你:
if(!current_user_can(\'delete_others_posts\')){
/*Handling wp media uloads*/
add_filter(\'wp_handle_upload_prefilter\',\'lets_handle_img_width\');
function lets_handle_img_width($file)
{
$img = getimagesize($file[\'tmp_name\']);
$width = $img[0];
if ($width < 350){
$file[\'error\'] = "Image is small too small. Get something of width more than 350px.";
}
return $file;
}
}
检查有关的官方文档
wp_handle_upload_prefilter.