WordPress Shouldn't Mess with post_type
|Reported by:||filosofo||Owned by:||ryan|
|Component:||Query||Keywords:||post_type, wp_query has-patch|
I have a custom post_type, "restaurant," and I'd like to query for the "restaurant" with name "joes-diner".
query_posts(array( 'post_type' => 'restaurant', 'name' => 'joes-diner', ));
fails because WP sees that I'm querying by name, sets $wp_query->is_single to true, which in turn sets post_type to "post."
If I wanted post_type to be "post" I wouldn't have specified "restaurant", would I?
Patch uses the given post_type when specified.