This function replaces the comment author’s link with the comment author’s profile page,
if the comment author is a registered user. Otherwise, the standard WordPress comment
author link is displayed.
This function is not mine and has been found googling.
function graphene_comment_author_profile_link(){
/* Get the comment author information */
global $comment;
$comment_ID = $comment->user_id;
$author = get_comment_author( $comment_ID );
$url = get_comment_author_url( $comment_ID );
/* Return the default WordPress comment author link if comment author is not
a registered user */
if ($comment_ID == 0){
if ( empty( $url ) || 'http://' == $url )
$return = $author;
else
$return = "<a href="https://wordpress.stackexchange.com/questions/91506/$url" rel="external nofollow" class="url">$author</a>";
} else {
/* Return the link to the comment author's profile age if otherwise */
$return = '<a href="'.home_url().'/?author=".$comment_ID."">'.$author.'</a>';
}
return $return;
}
add_filter('get_comment_author_link', 'graphene_comment_author_profile_link');