Make WordPress Core


Ignore:
Timestamp:
11/24/2008 06:14:40 AM (17 years ago)
Author:
ryan
Message:

Return null if queried object not found. fixes #8244

File:
1 edited

Legend:

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

    r9795 r9859  
    25252525            $cat = $this->get('cat');
    25262526            $category = &get_category($cat);
     2527            if ( is_wp_error( $category ) )
     2528                return NULL;
    25272529            $this->queried_object = &$category;
    25282530            $this->queried_object_id = (int) $cat;
     
    25312533            $tag = &get_term($tag_id, 'post_tag');
    25322534            if ( is_wp_error( $tag ) )
    2533                 return $tag;
     2535                return NULL;
    25342536            $this->queried_object = &$tag;
    25352537            $this->queried_object_id = (int) $tag_id;
     
    25392541            $term = &get_terms($tax, array('slug'=>$slug));
    25402542            if ( is_wp_error($term) || empty($term) )
    2541                 return $term;
     2543                return NULL;
    25422544            $term = $term[0];
    25432545            $this->queried_object = $term;
Note: See TracChangeset for help on using the changeset viewer.