From cf2aaf8393d019cef810df0afb28a37b3722e1df Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 15 Sep 2015 01:34:25 +0000 Subject: [PATCH] In `get_avatar_data()`, promote `stdClass` objects to `WP_Comment` if passed. Props DrewAPicture, ocean90. Fixes #32619. Built from https://develop.svn.wordpress.org/trunk@34160 git-svn-id: http://core.svn.wordpress.org/trunk@34128 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 8bed879cf4..baba9abf21 100644 --- a/wp-includes/link-template.php +++ b/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 ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 3c836ae1d6..3c8d0d3b4e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34159'; +$wp_version = '4.4-alpha-34160'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.