| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * @package Polylang | |
| 4 | - */ | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * Setups the posts languages and translations model |
| 8 | 5 | * |
| @@ -181,21 +178,11 @@ | ||
| 181 | 178 | $user = wp_get_current_user(); |
| 182 | 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! |
| 183 | 180 | } |
| 184 | 181 | |
| 185 | - // In edit context, show draft and future posts. | |
| 186 | - if ( 'edit' === $context ) { | |
| 187 | - $states = get_post_stati( | |
| 188 | - array( | |
| 189 | - 'protected' => true, | |
| 190 | - 'show_in_admin_all_list' => true, | |
| 191 | - ) | |
| 192 | - ); | |
| 193 | - | |
| 194 | - if ( in_array( $post->post_status, $states ) ) { | |
| 195 | - $user = wp_get_current_user(); | |
| 196 | - return is_user_logged_in() && ( current_user_can( 'edit_posts' ) || $user->ID == $post->post_author ); // Comparison must not be strict! | |
| 197 | - } | |
| 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! | |
| 198 | 185 | } |
| 199 | 186 | |
| 200 | 187 | return false; |
| 201 | 188 | } |