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');
// ....
}
So, if $_FILES['input_13']['name']
is empty, the rest of code that needs those files from wp-admin will fail.
Try to include the required files with a more appropiate logic.
Related Posts:
- Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false
- How to change upload directory in wp_handle_upload
- Decrease file size upload in Media
- Adding a custom image upload size and making it selected by default?
- Change the filename format of saved featured images
- Image Upload “exceeds the maximum upload size for this site”, but php.ini is correct
- How to register images uploaded via FTP in media library?
- Failed media upload: “The uploaded file was only partially uploaded.”
- Create Image Uploader for Widget
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- Modify image while uploading
- Debugging upload problem: What part of WP does actual image-resizing?
- How to resize image on client-side before upload?
- How to upload imagick resource to media in wordpress
- Accessing a random image via ajax
- Make WordPress upload directory outside wordpress root with custom url
- Is it unsafe to put php in the /wp-content/uploads directory?
- Upload images and attachments from frontend form
- WordPress media upload “HTTP error”
- Adding featured image via PHP
- How to enlarge the media file upload size in wordpress admin
- Restrict WordPress File Type Uploads by User Type
- File upload, uploads only file name
- Modify Maximum upload file size text
- Upload a json file in php [closed]
- Custom image upload
- wp_handle_upload – The uploaded file could not be moved to wp-content/uploads/2012/09
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- Memory errors with media upload, WordPress can’t use more than 96M (while there’s 512 available!)
- Get most recent media upload
- Convert all images to PNG on file upload
- Upload Image in a WordPress page using PHP
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- how to retrieve uploaded url of zip files
- Why is $_REQUEST an empty array in admin-ajax.php?
- How do I dynamically populate a shortcode with a variable from URL?
- Need help with Google drive API [closed]
- Keyword checking in Gravity Forms
- Upload file could not be moved to wp-content/uploads
- Gravity form built in Captcha
- How do I limit the number of forms a user can create in gravity forms?
- Change WordPress Upload Folder using wp handle upload
- How do I Import / Upload Files with jQuery AJAX?
- WordPress function when file is uploaded, deleted or edited
- Can I get an email notification when media is uploaded to the media library?
- Using data sent via AJAX in multiple functions on a WP plugin
- Logic on a Gravity Forms redirect [closed]
- Upload multiple files in randomly generated folder using wp_upload_bits
- Can’t upload CSV file to plugin directory using custom upload form in admin panel
- PHP -> SQL Query with Summing
- WordPress upload file size error even after raising php limits
- Get featured image with custom size outside WordPress
- Images Uploaded saving onto older/previous year folders
- How do I increase the upload size only when editing special pages?
- Get URL of Featured Image After wp_insert_post()
- Gravity Forms merge tags in templates?
- WordPress İmages Upload & Delete Error
- Allow user to Upload image and manipulate it on the frontend
- How to Make Thumbnail of Post Stay Animated
- How to decrease the max file upload size without using php.ini or htaccess?
- Some problems in custom widget
- Checking page before applying image restrictions while uploading
- Change image data durgin upload
- Hook on file upload
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- using shortcodes inside gravity forms
- I can’t set image ad fatured programatically
- How can I update WordPress plugins or WordPress itself in all server?
- Remove an action created by a Gravity Forms add-on
- async upload not working when not logged
- WordPress loading all local images from specific directory?
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- Trouble Accessing Gravity Forms API (GFAPI)
- Trying to generate a CSS file in wordpress uploads folder
- Confuse between forms and tables
- Maximum file Upload
- Change upload URL by mime type
- Run htmlentities() on all submitted values through gravity forms
- Right path for renaming a file in uploads folder
- I want url from a file in media using title file
- WordPress file upload
- Crop an image after upload on custom account page
- Restrict File Type Uploads by User on Wordress via functions.php
- wp_delete_attachment not working with multiple values
- Renaming “Expand Details” within “Add Media”
- Save the outputted image into the Media Library, with a different filename and extension
- 403 (Forbidden) delete file image in themer folder
- Is custom behaviour possible when asynchronously uploading?
- How to resize an image server-side before upload?
- Name Input from widget displays Sidebar name instead of saved data
- Can’t upload files
- Edit Image/Image Details – Replace button missing
- Code working in functions.php but not pluign for gavity forms
- How to automatically convert images to WebP on WordPress?
- Generate and upload screenshot as featured image for user-submitted post
- Pull latest Youtube Video from json url and make new post
- WordPress directories not writable after PHP version upgrade
- Upload multiple files via ajax from an HTML file input
- get_post_meta returns on side but it doesn’t return on bottom of admin page