even if you had included the all of the needed files you will still have to create your some extra hidden fields like _nonce to pass the
check_ajax_referer( "set_post_thumbnail-$post_ID" );
also you would need to create an action hidden field to identify the case of Ajax call with the value : "set-post-thumbnail"
You are better of creating your own Ajax call
and simply use in your callback function:
set_post_thumbnail( $post, $thumbnail_id );
//or
update_post_meta( $post->ID, '_thumbnail_id', $attachment_id );
and to unset use
delete_post_meta( $post_ID, '_thumbnail_id' );
Related Posts:
- Download an image from a webpage to the default uploads folder
- Is there a hook which fires after all thumbnails are generated?
- Frontend Post – Allow Only Image File Upload
- Can’t seem to attach uploaded image to post and set it as thumbnail
- How to stop thumbnail generation from some images and different size thumbnail generate
- How to replace images?
- How to set uploaded image as featured image wordpress
- adding image to post thumbnail from another server
- WordPress Multisite: Images moved to /sites/1?
- How to delete original image file after upload and resize
- An error has occurred during the upload process in wordpress version 5.3.2
- Troubles with code for upload a image
- How do I display a PDF thumbnail as a link to the PDF without uploading the image
- Featured Image add tab
- Image Upload from URL
- Programmatically get images by URL and save in uploads folder
- Upload images to remote server
- is it possible to replace the use of gd_lib with imagick or ImageMagick?
- How to insert images into posts without using Add Media dialog
- Media Upload Folder – how to manage
- Change WordPress image URLs via filter
- Any easy way to automatically set the first inline image in a post as the thumbnail?
- Upload multiple images in a custom metabox
- hook into completed image upload filter
- getting uploaded SVG dimensions on front-end
- Automating a Daily Picture Blog?
- Replace all of post’s image URLs with upload directory URLs
- set_post_thumbnail_size not cropping featured images, but reducing proportionally
- How do i upload an image and return the image id?
- WordPress function: limit size, only jpg, jpeg, limit of uploaded files per account
- Is it possible to prevent users from uploading small images?
- Can’t Display Featured Image in RSS Feed
- Filter to modify post_title after image upload?
- Automatically Add Caption in image
- Setup A Default Featured Image
- Find posts without featured image? [duplicate]
- How do I add a featured image to a single post page?
- Rename image during upload using date and time stamp?
- How to disable the suffix “-scaled” which is being added at the end of each uploaded image?
- Disable wordpress image sizes generation
- What’s the best “insert all images” plugin?
- Is 700,00 jpgs too many for a WordPress site.?
- Images not working using Featured post
- Woocommerce featured image of page – not product
- Generating different dimension images while uploading image file from custom plugin page
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- Store Snapshot created via wordpress to use with lightbox
- Image upload appearing as broken images following server move
- How do I fix “Sorry, this file type is not permitted for security reasons”
- How to implement secure frontend image upload? [closed]
- Can’t generate thumbnail images
- Change wp-content/uploads to uploads/%postname%/%image%
- Change media URL (images)
- Generate images to be associated for tag and category?
- Does wp_get_attachment_image_src also work with non-image files?
- Bulk-add featured images in posts with no featured image
- Upload media only to DB
- WordPress Creates Unused (Unregistered) Image Sizes
- Images don’t update after being edited
- Is there a way in WordPress to convert images to WebP without a plugin?
- Why doesn’t WordPress use the smaller sized image?
- Some Images Disappeared from Media Library?
- Remove Additional image sizes created by theme
- Dynamically determine the width and height of a image file to be cropped & uploaded AFTER form submission given fixed aspect ratio
- Disable image rename on upload
- HTTP error when uploading an image
- How can i identify media uploaded to my website that is not being used anywhere anymore?
- Placing a featured image into header
- How to add thumbnails to posts and pages automatically in a uniformed fixed elegant way?
- Upload images – Theme options
- image URL changed in wordpress
- image upload/edit is broken: “Image data does not exist. Please re-upload the image.”
- How to only show div of caption if caption exists on featured image
- WordPress append -1 to the image name
- Recreate the upload folder from a website without having access to the backend/cpanel/filezilla directly from the website
- How to echo images Urls from a wordpress post, that are relally in the post
- media_handle_upload() with 1 image under 1Mb chokes my server and returns timeout error
- WordPress Responsive Image ( srcset ) not work properly
- Could creation of various image sizes cause slow form submission response?
- Updated wordpress missing image upload area
- How to set a post featured image from an already made custom field
- Why does wp_get_attachment_image_src return the wrong size, when the correct size exists?
- stop wordpress from resizing feature gif images
- Change wordpress default upload path to another domain
- set_post_thumbnail_size only working for width
- Newly uploaded images are not updating in featured image
- How to stop a post from publishing if the file upload is not a image/gif
- WAMP install acts different than live install when uploading images
- How can I hook and edit on the fly an image uploaded
- problem with updating metabox of upload image
- Assign one featured image to multiple posts?
- Media upload in add comment meta box
- Create post thumbnails from images stored outside of uploads directory
- My image rotate 90 degree
- has_post_thumbnail() Returns False on Scheduled Posts
- wp_handle_upload Image sizes
- Can’t manage to display an uploaded picture (uploaded from a custom button) in the front end
- if user role is x – show image – wordpress
- Uploading media to wordpress API with C# HttpClient
- medium_large image size not displaying properly on the frontend?