You can use the get_comment_author_link
hook, which is part of the get_comment_author_link()
template tag, like your question already suggests. Then you only have to get the according user_id
, which can be done via the $comment
global, and construct the link you want accordingly.
Exemplary usage like shown below:
add_filter( 'get_comment_author_link', 'wpse144835_custom_comment_author_link' );
function wpse144835_custom_comment_author_link( $link ) {
global $comment;
$comment_user_id = $comment->user_id;
// code to create the new link
return $new_link;
}
Edit:
Responding regarding your questions, the according comment is unfortunately deleted, so this is kind of a informational shortlist now. There is a lot in there, way too much to really answer them, but I give you some additional information:
-
As we have the global available you can use
$comment->comment_author
-
As for functions, you can use
get_comment_author()
orcomment_author()
depending on your need toreturn
orecho
. -
At the Codex: Global Variables you can get an overview about them
-
There is the
WP_Comment_Query
and theWalker_Comment
class -
For example at the comment_author codex page is a list of comment related functions
-
Additionally I’d suggest you look through the
comment-template.php
and thecomment.php
to learn more about all of that