[wp-trac] [WordPress Trac] #27213: in_category() returns true in Home page on local install

WordPress Trac noreply at wordpress.org
Wed Feb 26 17:28:43 UTC 2014


#27213: in_category() returns true in Home page on local install
--------------------------+----------------------
 Reporter:  Marventus     |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Taxonomy      |     Version:  trunk
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------

Comment (by Marventus):

 Replying to [comment:1 helen]:
 Hi, Helen. Thanks for pitching in.
 > That said, I suspect your posts are not the same between environments
 Nope, actually, Dbs are the same (local is a dump from live with different
 site and home urls)

 > - `in_category()` applies to a specific post, and shouldn't be used in
 `wp_head` without checking if you're looking at a singular item or else
 you might get unpredictable results.
 I agree with you. I stumbled upon this by accident while trying something
 else, and wrote that little plugin for testing purposes only.
 However, the function should return the same output regardless of the
 environment WP is running on, right?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27213#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list