Add a is_user_logged_in() check.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
380d9c3487
commit
4b9d4641be
|
@ -1025,7 +1025,9 @@ class WP_Query {
|
|||
if ( is_admin() )
|
||||
$where .= " OR post_status = 'future' OR post_status = 'draft'";
|
||||
|
||||
$where .= current_user_can( "read_private_{$post_type}s" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'";
|
||||
if ( is_user_logged_in() ) {
|
||||
$where .= current_user_can( "read_private_{$post_type}s" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'";
|
||||
}
|
||||
|
||||
$where .= ')';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue