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

git-svn-id: https://develop.svn.wordpress.org/trunk@9774 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2008-11-19 05:02:24 +00:00
parent 41ad324958
commit 72621ce78b
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'] ) {