Show
Ignore:
Timestamp:
09/18/07 16:32:22 (1 year ago)
Author:
ryan
Message:

Add checks for WP_Error. Props filosofo. see #4809

Files:

Legend:

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

    r6071 r6125  
    3131function &get_category($category, $output = OBJECT, $filter = 'raw') { 
    3232    $category = get_term($category, 'category', $output, $filter); 
     33    if ( is_wp_error( $category ) ) 
     34        return $category; 
    3335 
    3436    _make_cat_compat($category); 
     
    5961        while ( ($curcategory->parent != 0) && ($curcategory->parent != $curcategory->term_id) ) { 
    6062            $curcategory = get_term($curcategory->parent, 'category'); 
     63            if ( is_wp_error( $curcategory ) ) 
     64                return $curcategory; 
    6165            $path = '/' . $curcategory->slug . $path; 
    6266        }