in_category function
public php v1 · immutable#Original function:function in_category( $category ) { // Check if the current post is in the given category global $post, $blog_id; $categories = get_object_term_cache($post->ID, 'category'); if ( false === $categories ) $categories = wp_get_object_terms($post->ID, 'category'); if(array_key_exists($category, $categories)) return true; else return false;}# modified line: $categories = wp_get_object_terms($post->ID, 'category', 'fields=tt_ids');