The reason was the post_id
key simply missing from the upload query.
It was there for the normal posts, but was being omitted in the custom-post-type uploads.
No idea why. The issue had something to do with the javascript uploader settings.
So I’ve asked another question regarding the pluploader
here and have managed to find the solution myself.
I do not know why was the post_id
being excluded, but at least it works now.
Related Posts:
- Prevent Delete Attachment by URL or When Submit
- Upload attachment from external site
- Get post attachment with post id
- Turn a URL into an Attachment / Post ID
- Submit post and upload image from front-end
- Delete Associated Media Upon Page Deletion
- Delete post with all files attached to it
- Is it possible to Schedule Attachments in WordPress?
- what types of order can I pass to get_posts() via orderby?
- Find the post an attachment is attached to
- media_handle_upload for local files?
- How to upload post thumbnail while wp_insert_post?
- How do I detach images from posts?
- Use an attachment in multiple posts
- delete post also attachments
- Replacing all attachment links in post with media file link
- Get post id by attachment id?
- Downloadable Documents
- How can I export WordPress posts’ attachments?
- How to remove images from showing in a post with the_content()?
- upload featured image from front end using wordpress add media button
- How do I create Comma Separated list of attached image ids?
- Get post embedded image caption
- Limit amount of results returned
- Easy way to delete 70k posts and attached media?
- How to get future ID for post which haven’t been created yet?
- How to access featured image?
- Load post attached images on a single page site with fancybox
- Too many connections to server
- creating front end image uploader that uploads images as posts
- Insert woocommerce products programmatically with featured image and gallery
- Add the description field on the attached media
- Set size for attachments
- I have a site where attachments in the wp_posts table have guid values of guid, how did this happen?
- Get all attachment by post excluding featured and content inside
- CF7 upload file failing [closed]
- Posts and Attachments with “Published” status in Search
- Get attachments for posts that belongs to a specific category
- Removal of Media Gallery pictures
- Automatically attach image to post if they have the same title
- Get Image tag from content of post
- How to get the last selected media alignment setting?
- Can’t update old posts 3.5.2
- WordPress Automatic Filename Changer
- How would one change the default url structure of attachments?
- redirect to uploaded (wordpress) post after form submission from front-end
- Get attachments only for this post
- Uploading images in custom post form
- Reinstall WordPress while keeping attachments
- Get images from the post
- How To Download WordPress Audio Attachments
- How to get the next and previous image title from attachment or gallery?
- How to call WordPress First Image Post or else Attached Image or Default
- All images on one line for each post
- How can I to add upload functionality outside of the admin area?
- Cannot create new posts or upload images using media manager
- unable to write to the database while uploading images
- How do I assign an attachment to a post using only the REST API?
- Unable to delete attached file from folder programmatically
- How to convert attachment pages to Posts?
- Delete attached images from posts
- Allow users to post their videos to my wordpress website?
- Unable to get all the Posts Attachments
- Why does media_handle_sideload upload to last month’s folder?
- Add in the url attachment loop the wp_link_pages of the post
- how to create other sizes of original image in one go wordpress uploads
- Stop images from being displayed on the front-end of the site
- Update all images url imported from HTML pages
- Disable Media uploader to users
- How to get images only attached from edit post page
- WordPress Media URLs?
- How to prevent people from seeing an attachment to a scheduled post that’s released in future?
- How can I get a comment ID on Submit?
- Inserting image into post content – Front End
- Bulk Attach Or Insert Media To Post Without Opening Post Editor
- Post Attachment missing head (stylesheets/js/what-not)
- Create post from form with image
- Get Video Attachment to post
- how to edit attachments?
- Broken images after importing posts and opening in Gutenberg
- Inserting Media on New Post But Hides Previous Uploads for Editor/Contributor
- What is the proper use of guid for images in wp_posts?
- Can`t attach image to a multiple posts
- WordPress portfolio posts: media not displaying if several images
- Does WordPress Super User or Administrators can create and edit post and media on behalf of a user
- Xhr.send : PDF upload failed with status 400 and response 0
- Modify upload directory to use post category slug in file path on multisite installation
- How to delete Full Size options from post Add Media?
- Conditionally exclude post from specific category on home page sidebar?
- How to list post as buch of category, and all of them
- Is it to possible to insert a page in the post depending on the category ofthe post
- How to display a “NEW”-icon on posts from today
- How to get post id of last approved comment?
- Posts and Pages w. private visibility don’t show up in existing content
- Custom post type slideshow background images to insert in a plugin
- Organization of time insensitive content
- Trim posts from WP-Query?
- WordPress wp_editor to post and edit
- How to display Post title By ID and its Thumb Contents
- latest post showing up twice on posts page