Make WordPress Core

Changeset 2975


Ignore:
Timestamp:
10/29/2005 10:24:27 PM (19 years ago)
Author:
matt
Message:

Cleaner, better, faster.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-functions-category.php

    r2943 r2975  
    416416
    417417function in_category($category) { // Check if the current post is in the given category
    418     global $post, $category_cache;
    419     $cats = '';
    420     foreach ( $category_cache[$post->ID] as $cat ) {
    421         $cats[] = $cat->cat_ID;
    422     }
    423 
    424     if ( in_array($category, $cats) )
     418    global $category_cache;
     419
     420    if ( isset( $category_cache[$post->ID][$category] ) )
    425421        return true;
    426422    else
    427423        return false;
    428424}
     425
    429426?>
Note: See TracChangeset for help on using the changeset viewer.