I have this problem since I have to use a query to get the attachments of a specific post.
So the query like:
$args = array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => -1, 'post_status' => 'inherit', 'post_parent' => $post->ID ); $attachments = get_posts($args); bla bla bla...
but… if I delete from my article an image, or if I delete the thumb article also, anyway that images are returned if I use that query.
So to see what’s happened, I went inside the database in the post table and I saw that the record did’t update.
Moreover, if I use the same image in more than one article, a new record is not add. So i think that for an image there’s is only one post_parent, even if used in more than one place.
Is it correct?
thanks in advanced for support
- The topic ‘Relations between images, posts and database’ is closed to new replies.