WordPress.org

Make WordPress Core

Ticket #8592: post.php.diff

File post.php.diff, 713 bytes (added by mtekk, 9 years ago)
  • post.php

     
    22392239        if ( $parent >= 0 )
    22402240                $where .= $wpdb->prepare(' AND post_parent = %d ', $parent);
    22412241
    2242         $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where ";
    2243         $query .= $author_query;
     2242        $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND (post_status = 'publish'";
     2243       
     2244        if ( is_admin() )
     2245                $query .= " OR post_status = 'private'";
     2246               
     2247        $query .= ")) $where " . $author_query;
    22442248        $query .= " ORDER BY " . $sort_column . " " . $sort_order ;
    22452249
    22462250        $pages = $wpdb->get_results($query);