WordPress.org

Make WordPress Core

Ticket #24648: 24648.2.patch

File 24648.2.patch, 606 bytes (added by rachelbaker, 4 years ago)

Show only approved comments if the current user cannot edit the comment

  • src/wp-admin/includes/ajax-actions.php

     
    951951        $x = new WP_Ajax_Response();
    952952        ob_start();
    953953        foreach ( $wp_list_table->items as $comment ) {
    954                 if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) )
     954                if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && 0 === $comment->comment_approved )
    955955                        continue;
    956956                get_comment( $comment );
    957957                $wp_list_table->single_row( $comment );