comment_author_email_link

Display the html email link to the author of the current comment.

Description

comment_author_email_link( (string) $linktext = '', (string) $before = '', (string) $after = '', (null) $comment = null ); 

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 site. 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.

Parameters (4)

0. $linktext — Optional. (string) => ''
Text to display instead of the comment author's email address. Default empty.
1. $before — Optional. (string) => ''
Text or HTML to display before the email link. Default empty.
2. $after — Optional. (string) => ''
Text or HTML to display after the email link. Default empty.
3. $comment — Optional. (null) => null
Comment ID or WP_Comment object. Default is the current comment.

Usage

  1. if ( !function_exists( 'comment_author_email_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/comment-template.php'; 
  3.  
  4. // Optional. Text to display instead of the comment author's email address. 
  5. // Default empty. 
  6. $linktext = ''; 
  7.  
  8. // Optional. Text or HTML to display before the email link. Default empty. 
  9. $before = ''; 
  10.  
  11. // Optional. Text or HTML to display after the email link. Default empty. 
  12. $after = ''; 
  13.  
  14. // Optional. Comment ID or WP_Comment object. Default is the current comment. 
  15. $comment = null; 
  16.  
  17. // NOTICE! Understand what this does before running. 
  18. $result = comment_author_email_link($linktext, $before, $after, $comment); 
  19.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/comment-template.php  
  1. function comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) { 
  2. if ( $link = get_comment_author_email_link( $linktext, $before, $after, $comment ) ) { 
  3. echo $link;