From 72621ce78bfd2d16eb5a9fc76943a418b4bf7f28 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 19 Nov 2008 05:02:24 +0000 Subject: [PATCH] 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 --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 3aa6326fb0..6b03ea43ea 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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'] ) {