PluginProbe
Polylang / 3.8.10
Polylang v3.8.10
3.8.10 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 All 234 releases
← All changes | src/translated-post.php +3 -2 3.8.4 → 3.8.10 View file →
@@ -90,8 +90,10 @@
90 90 '_pll' => true, // Polylang taxonomy.
91 91 )
92 92 );
93 93
94 + $this->add_sanitization_hooks( $this->tax_language );
95 +
94 96 add_action( 'setup_theme', array( $this, 'add_language_taxonomy_query_var' ) );
95 97 }
96 98
97 99 /**
@@ -299,10 +301,9 @@
299 301 )
300 302 );
301 303
302 304 if ( in_array( $post->post_status, $states ) ) {
303 - $user = wp_get_current_user();
304 - return is_user_logged_in() && ( current_user_can( 'edit_posts' ) || (int) $user->ID === (int) $post->post_author );
305 + return current_user_can( 'read_post', $post->ID );
305 306 }
306 307 }
307 308
308 309 return false;