[wp-hackers] Attaching photos to multiple posts

Paul paul at codehooligans.com
Wed Feb 2 22:12:13 UTC 2011

On Feb 2, 2011, at 4:44 PM, 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?

I've often thought there needs to be a better solution. Something better than having an image be a child or the parent post. Mainly because I came from using other CMS systems where they manage this different. And from the functional perspective like I want to change the image which is used across multiple pages. Or for example I see an image in the Media section and want to know that posts reference this image in the post_content. This is not built in functionality but is pretty easy to determine. 

Then again the user does have access to all images used on the site. Having that one to one association with a parent does not prevent using that image in multiple post. So for inserting images the user doesn't really care that one image is associated with a page or post and which image are not. 

I really don't see that creating duplicate entries in the database will be any more efficient. Not to mention cleanup when an image is deleted from the system. Sure this can be done. But the question should be why. 

Final answer -1. 


More information about the wp-hackers mailing list