Allow post_parent=0 queries to work. props stefano.verna. fixes #8085

git-svn-id: http://svn.automattic.com/wordpress/trunk@9774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-11-19 05:02:24 +00:00
parent cad8e31e39
commit 502707fa29
1 changed files with 1 additions and 1 deletions

View File

@ -1726,7 +1726,7 @@ class WP_Query {
$where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)";
}
if ( $q['post_parent'] )
if ( is_integer($q['post_parent']) )
$where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] );
if ( $q['page_id'] ) {