post_type ignored when it shouldn't be
|Reported by:||filosofo||Owned by:|
Sometimes you might want to retrieve a post-like object when you're agnostic about what type of post it is (for example, you don't know whether it's a post, page, or attachment).
This should work:
query_posts(array( 'post_type' => 'any', 'p' => 123, ));
However, it doesn't because WP sees that the "p" is set, sets is_single to true, and then the logic for the post_type part of the where clause means that post_type gets set to 'post'.
Instead, the where clause logic should give the "any" post_type priority, as it must be explicitly set (and therefore can be assumed to be the desired result).
Patch give the "any" post_type priority.