Changeset 56836
- Timestamp:
- 10/12/2023 12:36:29 PM (14 months ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r56747 r56836 654 654 655 655 $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID ); 656 657 $edit_post_cap = $post ? 'edit_post' : 'edit_posts'; 658 if ( 659 current_user_can( $edit_post_cap, $comment->comment_post_ID ) || 660 ( 661 empty( $post->post_password ) && 662 current_user_can( 'read_post', $comment->comment_post_ID ) 663 ) 664 ) { 665 // The user has access to the post 666 } else { 667 return false; 668 } 656 669 657 670 echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>"; -
trunk/src/wp-admin/includes/class-wp-list-table.php
r56665 r56836 851 851 $pending_comments_number 852 852 ); 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 } 853 867 854 868 if ( ! $approved_comments && ! $pending_comments ) { -
trunk/src/wp-admin/includes/dashboard.php
r56697 r56836 1110 1110 echo '<ul id="the-comment-list" data-wp-lists="list:comment">'; 1111 1111 foreach ( $comments as $comment ) { 1112 _wp_dashboard_recent_comments_row( $comment ); 1112 $comment_post = get_post( $comment->comment_post_ID ); 1113 if ( 1114 current_user_can( 'edit_post', $comment->comment_post_ID ) || 1115 ( 1116 empty( $comment_post->post_password ) && 1117 current_user_can( 'read_post', $comment->comment_post_ID ) 1118 ) 1119 ) { 1120 _wp_dashboard_recent_comments_row( $comment ); 1121 } 1113 1122 } 1114 1123 echo '</ul>';
Note: See TracChangeset
for help on using the changeset viewer.