Cleaner, better, faster.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-10-29 22:24:27 +00:00
parent 5521083d41
commit e0e5a1659c
1 changed files with 3 additions and 6 deletions

View File

@ -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;
}
?>