Title: WP_Comments_List_Table::floated_admin_avatar
Published: December 9, 2015
Last modified: February 24, 2026

---

# WP_Comments_List_Table::floated_admin_avatar( string $name, int $comment_id ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#wp--skip-link--target)

Adds avatars to comment author names.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#parameters)󠁿

 `$name`stringrequired

Comment author name.

`$comment_id`intrequired

Comment ID.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#return)󠁿

 string Avatar with the user name.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#source)󠁿

    ```php
    public function floated_admin_avatar( $name, $comment_id ) {
    	$comment = get_comment( $comment_id );
    	$avatar  = get_avatar( $comment, 32, 'mystery' );
    	return "$avatar $name";
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-comments-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/class-wp-comments-list-table.php#L66)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-comments-list-table.php#L66-L70)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#related)󠁿

| Uses | Description | 
| [get_avatar()](https://developer.wordpress.org/reference/functions/get_avatar/)`wp-includes/pluggable.php` |

Retrieves the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post.

  | 
| [get_comment()](https://developer.wordpress.org/reference/functions/get_comment/)`wp-includes/comment.php` |

Retrieves comment data given a comment ID or comment object.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_comments_list_table/floated_admin_avatar/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_comments_list_table%2Ffloated_admin_avatar%2F)
before being able to contribute a note or feedback.