From 7cd02175ffbdba671b89007e60d093beca14c84d Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Sat, 29 Oct 2005 22:24:27 +0000 Subject: [PATCH] Cleaner, better, faster. git-svn-id: https://develop.svn.wordpress.org/trunk@2975 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/template-functions-category.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index d21cfdaaa6..1237a599f4 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -415,15 +415,12 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde } function in_category($category) { // Check if the current post is in the given category - global $post, $category_cache; - $cats = ''; - foreach ( $category_cache[$post->ID] as $cat ) { - $cats[] = $cat->cat_ID; - } + global $category_cache; - if ( in_array($category, $cats) ) + if ( isset( $category_cache[$post->ID][$category] ) ) return true; else return false; } + ?> \ No newline at end of file