Don't show private and draft pages in post lists. fixes #2442

git-svn-id: https://develop.svn.wordpress.org/trunk@3528 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-02-14 06:23:03 +00:00
parent 0fff955751
commit b8dd301bf4
3 changed files with 6 additions and 6 deletions

View File

@@ -587,7 +587,7 @@ class WP_Query {
} elseif ($this->is_single) {
$where .= ' AND (post_type = "post")';
} else {
$where .= ' AND (post_type = "post" AND post_status = "publish"';
$where .= ' AND (post_type = "post" AND (post_status = "publish"';
if ( $pagenow == 'post.php' || $pagenow == 'edit.php' )
$where .= " OR post_status = 'future'";
@@ -595,9 +595,9 @@ class WP_Query {
$distinct = 'DISTINCT';
if ( is_user_logged_in() )
$where .= " OR post_author = $user_ID AND post_status = 'private')";
$where .= " OR post_author = $user_ID AND post_status = 'private'))";
else
$where .= ')';
$where .= '))';
}
// Apply filters on where and join prior to paging so that any