| @@ -178,21 +178,11 @@ | ||
| 178 | 178 | $user = wp_get_current_user(); |
| 179 | 179 | return is_user_logged_in() && ( current_user_can( $post_type_object->cap->read_private_posts ) || $user->ID == $post->post_author ); // Comparison must not be strict! |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - // In edit context, show draft and future posts. | |
| 183 | - if ( 'edit' === $context ) { | |
| 184 | - $states = get_post_stati( | |
| 185 | - array( | |
| 186 | - 'protected' => true, | |
| 187 | - 'show_in_admin_all_list' => true, | |
| 188 | - ) | |
| 189 | - ); | |
| 190 | - | |
| 191 | - if ( in_array( $post->post_status, $states ) ) { | |
| 192 | - $user = wp_get_current_user(); | |
| 193 | - return is_user_logged_in() && ( current_user_can( 'edit_posts' ) || $user->ID == $post->post_author ); // Comparison must not be strict! | |
| 194 | - } | |
| 182 | + if ( 'edit' === $context && 'draft' === $post->post_status ) { | |
| 183 | + $user = wp_get_current_user(); | |
| 184 | + return is_user_logged_in() && ( current_user_can( 'edit_posts' ) || $user->ID == $post->post_author ); // Comparison must not be strict! | |
| 195 | 185 | } |
| 196 | 186 | |
| 197 | 187 | return false; |
| 198 | 188 | } |