From 0f9477d5e86654c86b0e6f2a20603790eaa477d2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 25 Mar 2020 14:41:15 +0000 Subject: [PATCH] Docs: Add documentation for `WP_Comments_List_Table::floated_admin_avatar()`. Props akbarhusen, ayeshrajans, Soean, ajayghaghretiya1, netweb, SergeyBiryukov. Fixes #41491. git-svn-id: https://develop.svn.wordpress.org/trunk@47507 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-comments-list-table.php | 9 +++++++++ src/wp-admin/includes/comment.php | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 91ff88ec8d..be00e1f7b2 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -55,6 +55,15 @@ class WP_Comments_List_Table extends WP_List_Table { ); } + /** + * Adds avatars to comment author names. + * + * @since 3.1.0 + * + * @param string $name Comment author name. + * @param int $comment_ID Comment ID. + * @return string Avatar with the user name. + */ public function floated_admin_avatar( $name, $comment_ID ) { $comment = get_comment( $comment_ID ); $avatar = get_avatar( $comment, 32, 'mystery' ); diff --git a/src/wp-admin/includes/comment.php b/src/wp-admin/includes/comment.php index 4000fe7a36..9683c72883 100644 --- a/src/wp-admin/includes/comment.php +++ b/src/wp-admin/includes/comment.php @@ -181,12 +181,12 @@ function get_pending_comments_num( $post_id ) { } /** - * Add avatars to relevant places in admin, or try to. + * Adds avatars to relevant places in admin. * * @since 2.5.0 * * @param string $name User name. - * @return string Avatar with Admin name. + * @return string Avatar with the user name. */ function floated_admin_avatar( $name ) { $avatar = get_avatar( get_comment(), 32, 'mystery' );