Ticket #2613: private.2.diff
| File private.2.diff, 1.5 KB (added by ryan, 6 years ago) |
|---|
-
wp-includes/post-template.php
34 34 $title = $post->post_title; 35 35 if ( !empty($post->post_password) ) 36 36 $title = sprintf(__('Protected: %s'), $title); 37 else if ( 'private' == $post->post_status ) 38 $title = sprintf(__('Private: %s'), $title); 37 39 38 40 return $title; 39 41 } -
wp-includes/query.php
850 850 } else { 851 851 $where .= " AND (post_type = '$post_type' AND (post_status = 'publish'"; 852 852 853 if ( is_admin() ) {853 if ( is_admin() ) 854 854 $where .= " OR post_status = 'future' OR post_status = 'draft'"; 855 855 856 if ( is_user_logged_in() ) {857 if ( 'post' == $post_type )858 $cap = 'edit_private_posts';859 else860 $cap = 'edit_private_pages';856 if ( is_user_logged_in() ) { 857 if ( 'post' == $post_type ) 858 $cap = 'edit_private_posts'; 859 else 860 $cap = 'edit_private_pages'; 861 861 862 if ( current_user_can($cap) ) 863 $where .= "OR post_status = 'private'"; 864 else 865 $where .= " OR post_author = $user_ID AND post_status = 'private'"; 866 } 862 if ( current_user_can($cap) ) 863 $where .= " OR post_status = 'private'"; 864 else 865 $where .= " OR post_author = $user_ID AND post_status = 'private'"; 867 866 } 868 867 869 868 $where .= '))';
