I've just upgraded Wordpress to 2.5 but this is a problem that's affected me for a while.
When I select the manage link in the dashboard I can't view the posts to edit. It tells me that I have 456 published posts and 4 drafts but they don't display and I found out why. Here's the SQL statement that's supposed to grab the data
SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'editphp' AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC
I'm grabbing this from my MySQL log. What's strange is that it's trying to match the post_name with editphp which won't match unless I create a post with the name editphp. It's also looking for only posts with the type attachment when it should be post.
The same thing happens with the drafts. Here's is that statement as it's run
SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'editphp' AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'draft') ORDER BY wp_posts.post_modified DESC
I've been searching through the code but can't find where this statement is constructed. Any ideas?