copy attachments to another post type and change attachment url
If you want the image’s URL to be different, you need to first copy the image file to the user-specific folder and then create a new attachment for that copied image — i.e. clone the image’s “post” data. So replace this: // Get the attachments (IDs) attached to the `property` CPT. $prop_att_ids = (array) get_post_meta( … Read more