From cd50b4f95065f60334df53b5e4c8016883cf2283 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 25 May 2009 05:36:48 +0000 Subject: [PATCH] Restore LEFT JOIN for post_status_join. fixes #9851 see #9720 git-svn-id: https://develop.svn.wordpress.org/trunk@11452 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 e8fbeecfaf..2e2aa5aeb0 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2114,7 +2114,7 @@ class WP_Query { $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")"; } if ( $post_status_join ) { - $join .= " JOIN $wpdb->posts AS p2 ON ($wpdb->posts.post_parent = p2.ID) "; + $join .= " LEFT JOIN $wpdb->posts AS p2 ON ($wpdb->posts.post_parent = p2.ID) "; foreach ( $statuswheres as $index => $statuswhere ) $statuswheres[$index] = "($statuswhere OR ($wpdb->posts.post_status = 'inherit' AND " . str_replace($wpdb->posts, 'p2', $statuswhere) . "))"; }