Home › Forums › Backend Issues (wp-admin) › How to automatically detach a file from a post (deleted via edit post)? › Reply To: How to automatically detach a file from a post (deleted via edit post)?
Having this done automatically would be like saying that if an image is removed from “The Content” of a post that WP should automatically detach the image from the post or delete the image.
All images that are uploaded while editing a post are “attached” to that post.
In addition to this, if an image is uploaded while editing a different post then it is attached to that post. Selecting or inserting that image on a second post does not change or add that “attachment”. An image can only be attached to a single post and this attachment will never be changed automatically when selecting previously uploaded images.
Showing images or files based on what post they are attached to is prone to issues and you would be better off in the long run by showing a list of files that are actually current in the repeater.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.