WordPress function: limit size, only jpg, jpeg, limit of uploaded files per account
You cannot check the image before uploading, as WordPress is a serverside script. However, before inserting the image in the Media library, you have different options, as I explained in this answer, with filtering wp_handle_upload_prefilter. In your case, the function filtering the wp_handle_upload_prefilter would be something like this: add_filter(‘wp_handle_upload_prefilter’, ‘f711_image_size_prevent’); function f711_image_size_prevent($file) { // get … Read more