diff --git a/wp-includes/query.php b/wp-includes/query.php index 4b5aa1730c..2dcc95c949 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2448,6 +2448,9 @@ class WP_Query { } elseif ( $q['post__in'] ) { $post__in = implode(',', array_map( 'absint', $q['post__in'] )); $where .= " AND {$wpdb->posts}.ID IN ($post__in)"; + } elseif ( isset( $this->query['post__in'] ) ) { + $post__in = 0; + $where .= " AND 1=0 "; } elseif ( $q['post__not_in'] ) { $post__not_in = implode(',', array_map( 'absint', $q['post__not_in'] )); $where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)"; @@ -2458,6 +2461,9 @@ class WP_Query { } elseif ( $q['post_parent__in'] ) { $post_parent__in = implode( ',', array_map( 'absint', $q['post_parent__in'] ) ); $where .= " AND {$wpdb->posts}.post_parent IN ($post_parent__in)"; + } elseif ( isset( $this->query['post_parent__in'] ) ) { + $post_parent__in = 0; + $where .= " AND 1=0 "; } elseif ( $q['post_parent__not_in'] ) { $post_parent__not_in = implode( ',', array_map( 'absint', $q['post_parent__not_in'] ) ); $where .= " AND {$wpdb->posts}.post_parent NOT IN ($post_parent__not_in)";