WordPress.org

Make WordPress Core

Ticket #5110: in_category2.diff

File in_category2.diff, 591 bytes (added by markjaquith, 7 years ago)
  • wp-includes/category-template.php

     
    170170function in_category( $category ) { // Check if the current post is in the given category 
    171171        global $post, $blog_id; 
    172172 
     173        $category = abs(intval($category)); 
     174        if ( 0 == $category ) 
     175                return false; 
     176 
    173177        $categories = get_object_term_cache($post->ID, 'category'); 
    174178        if ( false === $categories ) 
    175179                $categories = wp_get_object_terms($post->ID, 'category');