From 2817bb65570e73030ea83ad6b9818a4d4a7953d1 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 15 Sep 2015 01:33:29 +0000 Subject: [PATCH] In `get_avatar_data()`, promote `stdClass` objects to `WP_Comment` if passed. Props DrewAPicture, ocean90. Fixes #32619. git-svn-id: https://develop.svn.wordpress.org/trunk@34160 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 8bed879cf4..baba9abf21 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -3604,6 +3604,10 @@ function get_avatar_data( $id_or_email, $args = null ) { $email_hash = ''; $user = $email = false; + if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) { + $id_or_email = get_comment( $id_or_email ); + } + // Process the user identifier. if ( is_numeric( $id_or_email ) ) { $user = get_user_by( 'id', absint( $id_or_email ) );