| @@ -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; |