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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.