Hi there
I am hoping this is possible! I would like to add a function that automatically deletes the existing feature image when a new image is uploaded in an edit form. Effectively replacing the image instead of adding another one so that a page/post can only have one image attachment.
Thanks in advance.
Rita
Hello. Thank you for contacting the Toolset support.
We do not encourage to do delete the existing uploaded image due to a logical reason behind that as it could be used by another post/page and if you can delete the image such posts/pages will be broken and image will not displayed.
Hi Minesh
I really appreciate your caution! However this site doesn't use any image on more than one post and each post has only one image. My client uploads many images (sometimes 10 or more...) to a post before choosing an image to publish and we now have 1000's of posts with forgotten images sitting on the database doing absolutely nothing. My client is also very reluctant to go to the media library in the dashboard and delete these many unwanted and unused images manually and would love for that to happen programmatically. I have tried to see if we can have a delete option on images in the media library accessed via the form but unfortunately this seems to be impossible with Toolset as well (https://toolset.com/forums/topic/allow-users-to-delete-their-own-media-attachements-via-cred-form/).
If there is a function that can achieve this I would love to be able to implement it and help this client manage her enormous and largely redundant media library.
Look forward to hearing from you.
Rita
Yes, I am aware of several very good plugins (which I have used to 'cleanup') but the aim here is to prevent rather than fix...
Is there really no function to delete the existing feature image when a new image is uploaded in an edit form?