﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
12287	Bug with : Query Posts, Post status and Custom Taxonomy	momo360modena	ryan	"I use a category for a events section of my website. I filter on two criters, one custom taxonomy, and a default WordPress category.

The request : 

query_posts( 'showposts=6&post_status=future&cat=7&taxonomy=departements&term=Gironde&order=ASC&orderby=date' )

The SQL query :

SELECT SQL_CALC_FOUND_ROWS wp_posts.* 
FROM wp_posts 
LEFT JOIN wp_posts AS p2 
	ON (wp_posts.post_parent = p2.ID) 
	WHERE 1=1 AND wp_posts.ID NOT IN ( SELECT tr.object_id FROM wp_term_relationships AS tr 
INNER JOIN wp_term_taxonomy 
	AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy = 'category' 
AND tt.term_id IN ('7') ) 
AND wp_posts.ID IN (765, ... ,796) 
AND wp_posts.post_type != 'revision' 
AND (
	(wp_posts.post_status = 'publish') 
	OR 
	(wp_posts.post_status = 'inherit' AND (p2.post_status = 'publish'))
) 
ORDER BY wp_posts.post_date DESC 
LIMIT 0, 4

The result :

I obtain post with the status publish and no future.

The cause :

line 1937, query.php, on trunk.
$q['post_status'] = 'publish';

Why force post_status here ?
I precise that this request work without the custom taxonomy on query_posts();"	defect (bug)	closed	normal	3.0	Query		normal	fixed		
