diff --git src/wp-includes/post.php src/wp-includes/post.php
index ced823c..b6bfcac 100644
|
|
function get_posts_by_author_sql( $post_type, $full = true, $post_author = null, |
5362 | 5362 | if ( false === $public_only ) { |
5363 | 5363 | if ( $cap ) { |
5364 | 5364 | // Does the user have the capability to view private posts? Guess so. |
5365 | | $post_status_sql .= " OR post_status = 'private'"; |
| 5365 | $post_status_sql .= " OR post_status = 'private' OR post_status = 'draft' OR post_status = 'pending'"; |
5366 | 5366 | } elseif ( is_user_logged_in() ) { |
5367 | 5367 | // Users can view their own private posts. |
5368 | 5368 | $id = get_current_user_id(); |
5369 | 5369 | if ( null === $post_author || ! $full ) { |
5370 | | $post_status_sql .= " OR post_status = 'private' AND post_author = $id"; |
| 5370 | $post_status_sql .= " OR post_status = 'private' OR post_status = 'draft' OR post_status = 'pending' AND post_author = $id"; |
5371 | 5371 | } elseif ( $id == (int) $post_author ) { |
5372 | | $post_status_sql .= " OR post_status = 'private'"; |
| 5372 | $post_status_sql .= " OR post_status = 'private' OR post_status = 'draft' OR post_status = 'pending'"; |
5373 | 5373 | } // else none |
5374 | 5374 | } // else none |
5375 | 5375 | } |