[wp-hackers] Tax Query Possible Bug

Baki Goxhaj banago at gmail.com
Mon Oct 28 23:48:57 UTC 2013


Nikola, that might be the issue. Will try tomorrow and update the thread.
Thanks for the heads up.

Kindly,

Baki Goxhaj
about.me/banago


On Mon, Oct 28, 2013 at 10:57 PM, Nikola Nikolov <nikolov.tmw at gmail.com>wrote:

> Are you by any chance trying to run the query before the init hook(or on a
> priority before the priority on which your taxonomies are registered) is
> run?
>
> That's usually the cause of taxonomy-related issues.
>
>
> On Mon, Oct 28, 2013 at 11:25 PM, J.D. Grimes <jdg at codesymphony.co> wrote:
>
> > 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
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> 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