I added a Types image field to a custom post type, which all works great.
But then on exporting the posts with all the custom fields, I noticed that in some cases the posts had multiple images as attachments.
On a closer look I noticed that this only happens when I change or updated an existing image. The more I change the image, the longer the list grows.
Example: "Image One" gets updated with "Image Two" then both show as attached to the same post.
Of course, after I found out, I could detach/remove the old attached images manually via the Media Library, but with a few hundred or even thousands of images, this could turn into a tedious task.
I think it would be great if on update/change of an image the existing image would be automatically detached.
What happens, is that this can lead to conflicts and issues in some Import / Export / Migration scenarios. At least there it was when I noticed this behavior.
Hello. Thank you for contacting the Toolset support.
I just created a test site with Types plugin and created Movie post type which have movie-pic as custom image field.
Then I try to add the first post for movie post type and try to add the image, at this time as this is brand new WP install, I uploaded the 5 images and then selected the 1 of them for my custom image field movie-pic and when I see the post meta table, I can see the correct image is assigned to post meta key wpcf-movie-key.
But when I see the post table and filter the post table with the post ID (for example: 9) and post type equal to attachment, I can see 5 entries as I uploaded 5 images.
We can not delete the attachment post as the uploaded images can be used by others. Please let me know if I misunderstood anything here.
It looks like it's just another fundamental flaw in the WordPress Concept, but after all - its still just a blogging System - patched with so much BandAid around that it is about to become a mummy ... 😉