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 8662bdaa50..95e6ab30fb 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -42,8 +42,9 @@ class WP_Comments_List_Table extends WP_List_Table { $post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0; - if ( get_option('show_avatars') ) - add_filter( 'comment_author', 'floated_admin_avatar' ); + if ( get_option( 'show_avatars' ) ) { + add_filter( 'comment_author', array( $this, 'floated_admin_avatar' ), 10, 2 ); + } parent::__construct( array( 'plural' => 'comments', @@ -53,6 +54,12 @@ class WP_Comments_List_Table extends WP_List_Table { ) ); } + public function floated_admin_avatar( $name, $comment_ID ) { + $comment = get_comment( $comment_ID ); + $avatar = get_avatar( $comment, 32, 'mystery' ); + return "$avatar $name"; + } + /** * @return bool */ @@ -591,8 +598,8 @@ class WP_Comments_List_Table extends WP_List_Table { /* translators: 2: comment date, 3: comment time */ printf( __( 'Submitted on %2$s at %3$s' ), $comment_url, /* translators: comment date format. See http://php.net/date */ - get_comment_date( __( 'Y/m/d' ) ), - get_comment_date( get_option( 'time_format' ) ) + get_comment_date( __( 'Y/m/d' ), $comment->comment_ID ), + get_comment_date( get_option( 'time_format' ), $comment->comment_ID ) ); if ( $comment->comment_parent ) { @@ -603,7 +610,7 @@ class WP_Comments_List_Table extends WP_List_Table { } echo ''; - comment_text(); + comment_text( $comment->comment_ID ); if ( $this->user_can ) { ?>