get_children returning deleted attachments
-
hiya,
i’m writing a function which will return the jpg attachments of a post:
// start snip
$images=&get_children(‘post_type=attachment&post_mime_type=image&post_parent=’.$post->ID);
print_r($images);
// end snipthis works well until i edit this post in wp-admin. if i remove the images from the post, this piece of code will still return the images as the children. all images i’ve ever uploaded to a post is returned, even if the latest revision doesn’t contain pictures at all.
i’ve removed these attachments in phpmyadmin for now but i can’t keep doing it for my client when i’ve handed the site over.
anyone figured out a way around this, or is this a bug in 2.7?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get_children returning deleted attachments’ is closed to new replies.