What filter/action hook can I use to add a few links to the admin comments page?

I would like to add a link to every comment when it’s displayed in the recent comments admin page (edit-comments.php).

For the sake of this question, the link should just be this: <a href="mailto:[comment-author-email]?subject=hello">Mail comment author</a> – the actual thing I want to put there isn’t really important, I just want to know how to do it. I have a few ideas for some things I want to add to the edit-comments.php page, so if you could help me understand where to place that example link in every comment, I’d be happy 🙂

Read More

I would like to place this link in the 2nd column. The first column is the tick-box for bulk actions; the second column has the comment author name, akismet approved stats, email address and IP address. I’d like to be able to add this information under those items.

Is this possible? I have been through the code for a few plug-ins that add links to the bottom of the comment itself, but I still can’t even clearly work out how to do that, let alone put additional items in the 2nd column. If people could also give advice on what filter to use (and how to use it) to place this same link underneath the comment body (3rd column), that’d be great. I’m fairly experienced in using hooks, but can’t get my head around this one.

I’d be very grateful for any help!

Related posts

Leave a Reply

1 comment

  1. There is no hook. The only place to print something to the screen is at the beginning of the field where $author_url = get_comment_author_url(); is executed.

    Sample:

    add_action( 'load-edit-comments.php', 'wpse_64737_comment_actions' );
    
    function wpse_64737_comment_actions( $url = '' )
    {
        if ( 'load-edit-comments.php' === current_filter() )
        {
            add_filter( 'get_comment_author_url', __FUNCTION__ );
            return;
        }
    
        echo '<p>Output in the Author field!</p>';
        return $url;
    }
    

    enter image description here

    You can move that output with JavaScript to the bottom of the field later.