Changeset 7505

Show
Ignore:
Timestamp:
03/24/08 20:39:05 (6 months ago)
Author:
ryan
Message:

in_category(): Return immediately if category is empty.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/category-template.php

    r7472 r7505  
    183183    global $post; 
    184184 
     185    if ( empty($category) ) 
     186        return false; 
     187 
    185188    $cat_ID = get_cat_ID($category); 
    186     if (0 != $cat_ID
     189    if ( $cat_ID
    187190        $category = $cat_ID; 
    188191 
     
    190193    if ( false === $categories ) 
    191194        $categories = wp_get_object_terms($post->ID, 'category'); 
    192     if(array_key_exists($category, $categories)
     195    if ( array_key_exists($category, $categories)
    193196        return true; 
    194197    else