[wp-trac] [WordPress Trac] #27213: in_category() returns true in Home page on local install
WordPress Trac
noreply at wordpress.org
Fri Feb 28 00:24:17 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 SergeyBiryukov):
Replying to [comment:2 Marventus]:
> Replying to [comment:1 helen]:
> > That said, I suspect your posts are not the same between environments
> Nope, they are actually. Dbs are the same (local is a dump from live
with different site and home urls)
You can modify your function to confirm that:
{{{
function tgitest_in_category() {
echo '<pre>'; print_r( get_post() ); echo '</pre>';
if ( in_category( 'reviews' ) )
echo 'This is a test for admins only. Please disregard.';
}
add_action( 'wp_head', 'tgitest_in_category' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27213#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list