WordPress.org

Make WordPress Core

Ticket #11697: 11697.diff

File 11697.diff, 728 bytes (added by Denis-de-Bernardy, 4 years ago)

keep private posts in the admin area, per Matt's suggestion

  • wp-includes/query.php

     
    21432143                } elseif ( !$this->is_singular ) { 
    21442144                        $where .= " AND ($wpdb->posts.post_status = 'publish'"; 
    21452145 
    2146                         if ( is_admin() ) 
     2146                        if ( is_admin() ) { 
    21472147                                $where .= " OR $wpdb->posts.post_status = 'future' OR $wpdb->posts.post_status = 'draft' OR $wpdb->posts.post_status = 'pending'"; 
    2148  
    2149                         if ( is_user_logged_in() ) { 
    21502148                                $where .= current_user_can( "read_private_{$post_type_cap}s" ) ? " OR $wpdb->posts.post_status = 'private'" : " OR $wpdb->posts.post_author = $user_ID AND $wpdb->posts.post_status = 'private'"; 
    21512149                        } 
    21522150