Changeset 57123 for trunk/src/wp-admin/includes/class-wp-list-table.php
- Timestamp:
- 11/17/2023 05:09:09 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r57120 r57123 829 829 */ 830 830 protected function comments_bubble( $post_id, $pending_comments ) { 831 $post_object = get_post( $post_id ); 832 $edit_post_cap = $post_object ? 'edit_post' : 'edit_posts'; 833 834 if ( ! current_user_can( $edit_post_cap, $post_id ) 835 && ( ! empty( $post_object->post_password ) 836 || ! current_user_can( 'read_post', $post_id ) ) 837 ) { 838 // The user has no access to the post and thus cannot see the comments. 839 return false; 840 } 841 831 842 $approved_comments = get_comments_number(); 832 843 … … 851 862 $pending_comments_number 852 863 ); 853 854 $post_object = get_post( $post_id );855 $edit_post_cap = $post_object ? 'edit_post' : 'edit_posts';856 if (857 current_user_can( $edit_post_cap, $post_id ) ||858 (859 empty( $post_object->post_password ) &&860 current_user_can( 'read_post', $post_id )861 )862 ) {863 // The user has access to the post and thus can see comments.864 } else {865 return false;866 }867 864 868 865 if ( ! $approved_comments && ! $pending_comments ) {
Note: See TracChangeset
for help on using the changeset viewer.