WordPress.org

Make WordPress Core

Changeset 6945


Ignore:
Timestamp:
02/20/2008 08:57:21 PM (14 years ago)
Author:
ryan
Message:

Allow comment object to be passed to get_avatar() for convenience. see #5775

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r6929 r6945  
    11871187        return false;
    11881188
     1189    $email = '';
    11891190    if ( is_numeric($id_or_email) ) {
    11901191        $id = (int) $id_or_email;
    11911192        $user = get_userdata($id);
    1192         if ( !$user)
    1193             $email = '';
    1194         else
     1193        if ( $user )
    11951194            $email = $user->user_email;
     1195    } elseif ( is_object($id_or_email) ) {
     1196        if ( !empty($id_or_email->user_id) ) {
     1197            $id = (int) $id_or_email->user_id;
     1198            $user = get_userdata();
     1199            if ( $user)
     1200                $email = $user->user_email;
     1201        } elseif ( !empty($id_or_email->comment_author_email) ) {
     1202            $email = $id_or_email->comment_author_email;
     1203        }
    11961204    } else {
    11971205        $email = $id_or_email;
Note: See TracChangeset for help on using the changeset viewer.