function get_comment_author_email_link($linktext='', $before='', $after='') {}

Return the html email link to the author of the current comment.
Care should be taken to protect the email address and assure that email harvesters do not capture your commentors’ email address. Most assume that their email address will not appear in raw form on the blog. Doing so will enable anyone, including those that people don’t want to get the email address and use it for their own means good and bad.


  • string $linktext: The text to display instead of the comment author’s email address
  • string $before: The text or HTML to display before the email link.
  • string $after: The text or HTML to display after the email link.

Defined filters

  • comment_email
    apply_filters('comment_email', $comment->comment_author_email)

Source code

function get_comment_author_email_link($linktext='', $before='', $after='') {

	global $comment;

	$email = apply_filters('comment_email', $comment->comment_author_email);

	if ((!empty($email)) && ($email != '@')) {

	$display = ($linktext != '') ? $linktext : $email;

		$return  = $before;

		$return .= "<a href='mailto:$email'>$display</a>";

	 	$return .= $after;

		return $return;

	} else {

		return '';




No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: