Hook to edit an column on comments screen?

At the moment I’m doing

add_filter("manage_edit-comments_columns", function($columns) {
        $columns_one = array_slice($columns,0,1);
        $columns_two = array_slice($columns,1);
        $columns_one["user"] = "User";
        $columns = $columns_one + $columns_two;
        return $columns;

add_filter( 'manage_comments_custom_column', function($column, $column_id) {
        echo "Test";
    },10, 2 );

Is there a way to just edit the author column instead of removing and creating my own?

Solutions Collecting From Web of "Hook to edit an column on comments screen?"

There is no filter for this column. So answer is ‘No’.

WP_List_Table search for method column_{something} inside class of Lister. Comments List class has column_author. So kill this column, and create filter as you do now.

I came to this question since I needed a similar thing. While an answer by qwerty-qwerty is correct, it’s correct only partially so to say. As far as I understand, author needed to change a column name, while I needed to change contents of the author column itself. So, while this is a bit different, I’ll just leave it here in case someone finds this question like I did. This also works if you need to get some additional data regarding comments which isn’t stored in meta table and isn’t not cached like said table and don’t want to do separate query for each item.

So, what you can do is hook into the_comments filter. This filter passes an array of of WP_Comment_Object instances for each comment found that matches the request. In my case, comments could be saved with name other than user’s display name, so where it was the case, I needed to get an actual display name from wp_users table and display it like comment_author_from_wp_comments (display_name_from_wp_users). I went through array passed by the filter, figured which comments needed additional info from wp_users table, ran a single query to that table, then modified elements within original array with new data. Here’s a general idea of how my code works:

function my_filter($objects)
    global $current_screen;
    if (is_admin() && $current_screen->id == 'edit-comments') // I only needed it on that screen within admin
        if (count($objects) > 0)
            foreach ($objects as $key => $object)
                //find out which comments needed 'fixing'
            //do the actual fixing
    return $objects; //return modified or unmodified array
add_filter('the_comments', 'my_filter');

Hopefully, someone in the future will find this useful.