I have a problem with category__in
when I do a WP_Query.
$query_args = array(
'post_type' => 'posts',
'nopaging' => true,
);
$categories = array(1,8); // If I use this, I get 3 posts
$categories = array(8, 1); // If I use this, I get 2 posts
$query_args['category__in'] = $categories;
$query = new WP_Query($query_args);
Apparently I get different results when I pass it "array(1,8)" than when I pass it "array(8,1)".
Is the order important??? Or is this a bug??
UPDATE
This is the request for the case array(1,8)
string(571) "SELECT wp_posts.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id) LEFT JOIN wp_term_relationships AS tt2 ON (wp_posts.ID = tt2.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (1) AND tt1.term_taxonomy_id IN (1) AND tt2.term_taxonomy_id IN (1,8) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC "
and for array(8,1)
string(571) "SELECT wp_posts.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id) LEFT JOIN wp_term_relationships AS tt2 ON (wp_posts.ID = tt2.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (8) AND tt1.term_taxonomy_id IN (8) AND tt2.term_taxonomy_id IN (1,8) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC "
echo $query->request;
for those two cases?