Home › Forums › General Issues › Can’t remove uploaded image from dokan produkt › Reply To: Can’t remove uploaded image from dokan produkt
ACf does not automatically delete images from the media library when they they are removed from images fields.
I have no idea how you would do this with the plugin you are using.
Just looking at ACF what you would do is create an acf/save_post action with a priority <10. In the action you use get_field() to get the current value of the field. The new value of the field will be in $_POST[‘acf’][$field_key]. The you would compare these 2 values. If the post ID for the old image is not present in new submission then you would use WP function to delete the attachment from media.
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.