On this page
WP_Comments_List_Table::floated_admin_avatar( string $name, int $comment_id ): string
Adds avatars to comment author names.
Parameters
$namestring Required-
Comment author name.
$comment_idint Required-
Comment ID.
Return
string Avatar with the user name.
Source
File: wp-admin/includes/class-wp-comments-list-table.php. View all references
public function floated_admin_avatar( $name, $comment_id ) {
$comment = get_comment( $comment_id );
$avatar = get_avatar( $comment, 32, 'mystery' );
return "$avatar $name";
}
Related
Uses
| Uses | Description |
|---|---|
| get_avatar() wp-includes/pluggable.php | Retrieves the avatar |
| get_comment() wp-includes/comment.php | Retrieves comment data given a comment ID or comment object. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar