﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
10657,Allow many-to-many relationship between posts and attachments,morgansson,,"For example if you have uploaded an image to a post, and then you want to re-use it in another post, that image ""post_parent"" cell in the database will be the first ""post_id"" where it was added only and not both. I think it should be an array for many reasons, and because I don't see any problem if this changes this way.
----
I'm actually using this code to get the thumbnails for each post in the main page of my site.

{{{
function bdw_get_images($imagesize='large') {
    global $post;
    // Get the post ID
    $iPostID = $post->ID;
    $image = null; // Clear the value from the previous post
    // Get all attachments from the post ID with type image
    $attachments =& get_children(array('post_parent'=>$iPostID,'post_type'=>'attachment','post_mime_type'=>'image'));
 
    // If attachments are found...
    if ($attachments == TRUE) {
        // ... go through all of them
        foreach($attachments as $att) {
            // Get the image source for every image attachment found
            // Post_ID, Size ('thumbnail', 'medium', 'large', 'full' or an Array), Icon (true/false)
            $image = wp_get_attachment_image_src($att->ID,$imagesize,false);
            break; // Comment this line to get all images inside the post
        }
    }
    if (isset($image)) { 
		return $image[0]; 
	} else {
		return false;
	}
}
}}}
The problem here is that the thumbnail is only showing on the first post where it was attached to. 
I know there are other ways to do what I want, but I just think this is the most semantic and the agile way. 

I hope you could implement the change in further WordPress versions because it might open a lot of new possibilities on posting.

Thanks for your time.",feature request,closed,normal,,Media,2.8.4,normal,maybelater,needs-patch,eric@… mikeschinkel@… dreamwhisper emzo knut@… caspar@… code@…
