[wp-hackers] Tax Query Possible Bug

J.D. Grimes jdg at codesymphony.co
Mon Oct 28 21:25:35 UTC 2013


Yes, I think this is normal, though it is confusing to lots of developers. The “AND 0=1” is automatically added when a query shouldn’t return any results - at least that is what I remember Nacin saying somewhere, I think.

-J.D.

On Oct 28, 2013, at 5:22 PM, Baki Goxhaj <banago at gmail.com> wrote:

> I'm running a tax query and I'm getting no results. From debugging I found
> this rather interesting result:
> 
>> [request] => SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  WHERE 1=1  AND 0 = 1 AND wp_posts.post_type ...
>> 
>> Interestin Part => ... WHERE 1=1  AND 0 = 1 ...
> 
> Is this a normal behaviour?
> 
> PS: I use the same exact code somewhere else in the site and it works fine.
> In this case I'm using this code inside a function in function.php.
> 
> Kindly,
> 
> Baki Goxhaj
> about.me/banago
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list