WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/12/2015 12:19:34 AM (6 years ago)
Author:
pento
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r31114 r31153  
    33893389 *     Along with the arguments passed in $args, this will contain a couple of extra arguments.
    33903390 *
    3391  *     @type bool         $found_avatar True if we were able to find an avatar for this user,
    3392  *                                      false or not set if we couldn't.
    3393  *     @type false|string $url          The URL of the avatar we found, or false if we couldn't find an avatar.
     3391 *     @type bool   $found_avatar True if we were able to find an avatar for this user,
     3392 *                                false or not set if we couldn't.
     3393 *     @type string $url          The URL of the avatar we found.
    33943394 * }
    33953395 */
     
    35483548     * @param int|object|string $id_or_email   A user ID, email address, or comment object.
    35493549     */
    3550     $args = apply_filters( 'get_avatar_data', $args, $id_or_email );
    3551 
    3552     // Don't return a broken URL if we couldn't find the email hash, and none of the filters returned a different URL.
    3553     if ( ! $email_hash && $url === $args['url'] ) {
    3554         $args['url'] = false;
    3555     }
    3556 
    3557     return $args;
    3558 }
     3550    return apply_filters( 'get_avatar_data', $args, $id_or_email );
     3551}
Note: See TracChangeset for help on using the changeset viewer.