[wp-hackers] Attaching photos to multiple posts

aesqe aesqe at skyphe.org
Wed Feb 2 22:08:47 UTC 2011

That's exactly how I did it in my File Gallery plugin :)

Each attachment copy gets a meta key '_is_copy_of' (value = original 
attachment ID ), and each 'original' attachment gets a meta key 
'_has_copies' (value = array with IDs of all of its copies).

(shameless plugin link: <http://wordpress.org/extend/plugins/file-gallery/>)

I'd also like to know if anyone has any problems with this method, or 
suggestion of a better way to do it.

cheers ;)

On 2.2.2011 22:44, William Davis wrote:
> One of the biggest hurdles to overcome, in my opinion, when using
> WordPress as a full-on CMS is the inability to attach photos to multiple
> posts. I've been mulling over a solution for some time, and I think I've
> found an acceptable solution, but I wanted to float it here to make sure
> there wouldn't be any adverse effects.
> A few ideas that I've had involve meta data or custom taxonomies, like
> Co-Authors Plus uses. But I thought the best solution might be to
> essentially duplicate the attachment and attach the duplicate attachment
> to the post, so that it degrades gracefully if the plugin is
> deactivated. Essentially, copy over the post (but don't create a
> duplicate image, to save server space). Does anybody anticipate any
> problems?
> Thanks,
> Will
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list