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'] ) {