get_comment_author filter-hookWP 1.5.0

Filters the returned comment author name.

Usage

add_filter( 'get_comment_author', 'wp_kama_get_comment_author_filter', 10, 3 );

/**
 * Function for `get_comment_author` filter-hook.
 * 
 * @param string     $author     The comment author's username.
 * @param string     $comment_ID The comment ID as a numeric string.
 * @param WP_Comment $comment    The comment object.
 *
 * @return string
 */
function wp_kama_get_comment_author_filter( $author, $comment_ID, $comment ){

	// filter...
	return $author;
}
$author(string)
The comment author's username.
$comment_ID(string)
The comment ID as a numeric string.
$comment(WP_Comment)
The comment object.

Changelog

Since 1.5.0 Introduced.
Since 4.1.0 The $comment_ID and $comment parameters were added.

Where the hook is called

get_comment_author()
get_comment_author
wp-includes/comment-template.php 49
return apply_filters( 'get_comment_author', $author, $comment_ID, $comment );

Where the hook is used in WordPress

Usage not found.