comment_author_url

Display the url of the author of the current comment.

Description

comment_author_url( (int) $comment_ID = 0 ); 

Parameters (1)

0. $comment_id — Optional. (int)
WP_Comment or the ID of the comment for which to print the author's URL.

Usage

  1. if ( !function_exists( 'comment_author_url' ) ) { 
  2. require_once ABSPATH . WPINC . '/comment-template.php'; 
  3.  
  4. // Optional. WP_Comment or the ID of the comment for which to print the author's URL. 
  5. // Default current comment. 
  6. $comment_id = -1; 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = comment_author_url($comment_id); 
  10.  

Defined (1)

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

/wp-includes/comment-template.php  
  1. function comment_author_url( $comment_ID = 0 ) { 
  2. $comment = get_comment( $comment_ID ); 
  3. $author_url = get_comment_author_url( $comment ); 
  4.  
  5. /** 
  6. * Filters the comment author's URL for display. 
  7. * @since 1.2.0 
  8. * @since 4.1.0 The `$comment_ID` parameter was added. 
  9. * @param string $author_url The comment author's URL. 
  10. * @param int $comment_ID The comment ID. 
  11. */ 
  12. echo apply_filters( 'comment_url', $author_url, $comment->comment_ID );