get_comment_author()
Retrieve the author of the current comment.
If the comment has an empty comment_author field, then 'Anonymous' person is assumed.
Uses: get_comment()
Used By: get_comment_author_link(), comment_author()
Hooks from the function
Return
String
. The comment author
Usage
get_comment_author( $comment_id );
- $comment_id(int|WP_Comment)
- WP_Comment or the ID of the comment for which to retrieve the author.
Default: current comment
Examples
#1 Get the name of the author of the current comment in the loop
echo get_comment_author( $comment_ID ); //> Eugene
Changelog
Since 1.5.0 | Introduced. |
Since 4.4.0 | Added the ability for $comment_id to also accept a WP_Comment object. |