I have an issue with user uploading large images. I have prevented this with this snippet...
add_filter('wp_handle_upload_prefilter', 'f711_image_size_prevent');
function f711_image_size_prevent($file) {
$size = $file['size'];
$size = $size / 1024; // Calculate down to KB
$type = $file['type'];
$is_image = strpos($type, 'image');
$limit = 5000; // Your Filesize in KB
if ( ( $size > $limit ) && ($is_image !== false) ) {
$file['error'] = 'Image files must be smaller than '.$limit.'KB';
}
return $file;
}
This works great but the Media Upload page still shows text saying "Maximum upload file size: 64 MB"
I assume it pulls this value from the servers PHP config, is there a way to modify this text?