[wp-hackers] in_category() and Pages

Sergey Biryukov sergeybiryukov.ru at gmail.com
Fri Dec 17 16:49:36 UTC 2010


On Wed, Dec 15, 2010 at 8:32 AM, Andrew Nacin <wp at andrewnacin.com> wrote:
> On Tue, Dec 14, 2010 at 5:56 PM, Sergey Biryukov <sergeybiryukov.ru@
> gmail.com> wrote:
>
>> I've noticed that in_category(1) returns true for some pages (i.e.
>> About) both in WordPress 3.0.3 and 3.1-beta1-16884 with Twenty Ten
>> theme and no plugins.
>
> Can't reproduce. Pages don't have categories and therefore in_category(
> $name_slug_or_id ) should always return false.
>
> Please try the wp-testers list in the future.
>
> If you can debug why this is happening, that'd be great.

I've tracked this down to some wrong records in wp_term_relationships
on both of the installations, which connected the pages with the first
category. Not sure where they came from, but I guess it's not a bug.

Will use wp-testers list next time. Thanks!

Sergey


More information about the wp-hackers mailing list