Make WordPress Core


Ignore:
Timestamp:
09/18/2007 04:32:22 PM (18 years ago)
Author:
ryan
Message:

Add checks for WP_Error. Props filosofo. see #4809

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r6121 r6125  
    392392    $term = (int) $term;
    393393    $term = get_term( $term, $taxonomy );
    394 
    395394    if ( is_wp_error($term) )
    396395        return $term;
     
    802801    if ( is_taxonomy_hierarchical($taxonomy) ) {
    803802        $term_obj = get_term($term, $taxonomy);
     803        if ( is_wp_error( $term_obj ) )
     804            return $term_obj;
    804805        $parent = $term_obj->parent;
    805806
     
    12531254        if ( !is_object($term) ) {
    12541255            $term = get_term($term, $taxonomy);
     1256            if ( is_wp_error( $term ) )
     1257                return $term;
    12551258            $use_id = true;
    12561259        }
Note: See TracChangeset for help on using the changeset viewer.