Use correct capabilities checks when determining whether to show private posts. Props molecularbear. fixes #3827
git-svn-id: https://develop.svn.wordpress.org/trunk@4940 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f8e2216f0e
commit
11d28a5c07
@ -966,9 +966,9 @@ class WP_Query {
|
|||||||
|
|
||||||
if ( is_user_logged_in() ) {
|
if ( is_user_logged_in() ) {
|
||||||
if ( 'post' == $post_type )
|
if ( 'post' == $post_type )
|
||||||
$cap = 'edit_private_posts';
|
$cap = 'read_private_posts';
|
||||||
else
|
else
|
||||||
$cap = 'edit_private_pages';
|
$cap = 'read_private_pages';
|
||||||
|
|
||||||
if ( current_user_can($cap) )
|
if ( current_user_can($cap) )
|
||||||
$where .= " OR post_status = 'private'";
|
$where .= " OR post_status = 'private'";
|
||||||
|
Loading…
Reference in New Issue
Block a user