[wp-trac] [WordPress Trac] #10651: Problem with image added "by hand" and get_children(...image...)
WordPress Trac
wp-trac at lists.automattic.com
Wed Aug 19 16:15:44 UTC 2009
#10651: Problem with image added "by hand" and get_children(...image...)
--------------------------+-------------------------------------------------
Reporter: metabaron | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: 2.8.5
Component: Media | Version: 2.8.4
Severity: critical | Keywords: media
--------------------------+-------------------------------------------------
I'm using the latest version of wordpress mu 2.8.4
Start adding two images to your newly create bug (just to be sure, I
tested on blank wordpress mu site).
Let's say they are named "a.jpg" and "b.jpg"
Get a very simple page:
{{{
<?php if (have_posts()) : while (have_posts()) : the_post();
$images =& get_children(
"post_type=attachment&post_mime_type=image$post_parent".$post->ID);
foreach ( $images as $attachment_id => $attachment ) {
$temp=wp_get_attachment_image_src( $attachment_id,$size='full' );
}
?>
<p><a href="<?php the_permalink() ?>"><img style="border:10px solid
#000000;" height="90%" width="90%" src="<?php echo $temp[0]; ?>"
alt="<?php t\
he_title(); ?>" /></a></p>
}}}
Now, create one post and insert "a.jpg" image using the 'add media'
button. Do the same in a new post but, this time, add "b.jpg" using 'add
media' button.
So, you should see both images
Now, '''by hand''', in the second post, change "b.jpg" for "a.jpg" and
refresh your page: '''the images are always the same a and b''', not a and
a at it should be ...
And, if you look at 'Library', you see that "a.jpg" and "b.jpg" are
pointing to there respective post when "b.jpg" should point nowhere ...
This seems to be a bug somewhere in the code when adding an image "by
hand" and it was functional before in the previous version
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10651>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list