From 3d051df3c915325ff6b03ccbd7547d4701741696 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 12 Jan 2015 00:20:24 +0000 Subject: [PATCH] In `get_avatar_data()`, there's no need to return `false` if we couldn't find an avatar, as Gravatar can handle being given an empty email hash. This allows the default avatar to show when no email address is given. See #21195 Built from https://develop.svn.wordpress.org/trunk@31153 git-svn-id: http://core.svn.wordpress.org/trunk@31134 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 15 ++++----------- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 33ca62a395..b679cd1cfc 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -3388,9 +3388,9 @@ function get_avatar_url( $id_or_email, $args = null ) { * @return array $processed_args { * Along with the arguments passed in $args, this will contain a couple of extra arguments. * - * @type bool $found_avatar True if we were able to find an avatar for this user, - * false or not set if we couldn't. - * @type false|string $url The URL of the avatar we found, or false if we couldn't find an avatar. + * @type bool $found_avatar True if we were able to find an avatar for this user, + * false or not set if we couldn't. + * @type string $url The URL of the avatar we found. * } */ function get_avatar_data( $id_or_email, $args = null ) { @@ -3547,12 +3547,5 @@ function get_avatar_data( $id_or_email, $args = null ) { * @param array $args Arguments passed to get_avatar_data(), after processing. * @param int|object|string $id_or_email A user ID, email address, or comment object. */ - $args = apply_filters( 'get_avatar_data', $args, $id_or_email ); - - // Don't return a broken URL if we couldn't find the email hash, and none of the filters returned a different URL. - if ( ! $email_hash && $url === $args['url'] ) { - $args['url'] = false; - } - - return $args; + return apply_filters( 'get_avatar_data', $args, $id_or_email ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index dfa41d0959..80c505356d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31152'; +$wp_version = '4.2-alpha-31153'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.