Add checks for WP_Error. Props filosofo. see #4809

git-svn-id: https://develop.svn.wordpress.org/trunk@6125 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-09-18 16:32:22 +00:00
parent 37d5915b8e
commit 5917c5458c
23 changed files with 151 additions and 29 deletions
+4
View File
@@ -940,6 +940,8 @@ class WP_Query {
if ( !empty($q['category__not_in']) ) {
$ids = get_objects_in_term($q['category__not_in'], 'category');
if ( is_wp_error( $ids ) )
return $ids;
if ( is_array($ids) && count($ids > 0) ) {
$out_posts = "'" . implode("', '", $ids) . "'";
$whichcat .= " AND $wpdb->posts.ID NOT IN ($out_posts)";
@@ -1415,6 +1417,8 @@ class WP_Query {
} else if ($this->is_tag) {
$tag_id = $this->get('tag_id');
$tag = &get_term($tag_id, 'post_tag');
if ( is_wp_error( $tag ) )
return $tag;
$this->queried_object = &$tag;
$this->queried_object_id = (int) $tag_id;
} else if ($this->is_posts_page) {