media_handle_upload fails with gravity form submitted image
That error is very probabbly due to incorrect loading of the required files from wp-admin; note how in your code those files are loaded only when a scpecific input has data (input_13) but not in every case you need those files. You do this: if( !empty($_FILES[‘input_13’][‘name’])) { require_once(ABSPATH . ‘wp-admin/includes/file.php’); require_once(ABSPATH . ‘wp-admin/includes/image.php’); // …. … Read more