3.1 get_children attachment problem
-
$attachments = get_children(array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'numberposts' => 999, 'post_parent' => $post->ID ));
This bit of code normal returns all of the attachments on a post. After upgrading to 3.1, it stopped working. Using print_r on $attachments shows it to be an empty array.
This is being used inside the WordPress loop.
I took a peek with phpmyadmin to see if it was a database problem, but the image I’m testing on meets the criteria of my get_children request.
I downgraded back to 3.05 and the problem persists, so I think it’s a database issue. I consider myself to have a pretty strong understanding of WordPress, but I’m weak on the database side. Any suggestions of how to work around this?
- The topic ‘3.1 get_children attachment problem’ is closed to new replies.