PluginProbe
Polylang / 2.6.2
Polylang v2.6.2
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | include/translated-post.php +3 -16 2.92.6.2 View file →
@@ -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 }