Getting a child (i.e. attached image) in a published post works fine:
$imgargs = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => -1,
'post_status' => 'any',
'post_parent' => $post->ID
);
$images =& get_children( $imgargs,ARRAY_A);
$link = array();
foreach ( $images as $attachment_id => $attachment ) {
$link[] = $attachment_id;
}
Doing the same on a draft post returns nothing. I guess this is by design (having look at wp_posts).
Any idea/tip on how I can find the attached images to a draft post? I need for an add-in to /wp-admin/post.php?action=edit