Opened 12 years ago
Closed 12 years ago
#25803 closed defect (bug) (fixed)
wrong url for get_avatar
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.8 | Priority: | normal |
| Severity: | major | Version: | |
| Component: | Comments | Keywords: | has-patch |
| Focuses: | Cc: |
Description
description
- one user registered at website.
- write a comment.
- remove the user.
- the user's avatar is wrong.
solve it
if not had user for $comment->user_id, use $comment->comment_author_email
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
Replying to mauryaratan:
not here. in function get_avatar of wp-includes/pluggable.php.
===old code:===
// No avatar for pingbacks or trackbacks $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) ) return false; if ( !empty($id_or_email->user_id) ) { $id = (int) $id_or_email->user_id; $user = get_userdata($id); if ( $user) $email = $user->user_email; } elseif ( !empty($id_or_email->comment_author_email) ) { $email = $id_or_email->comment_author_email; }===new code:===
// No avatar for pingbacks or trackbacks $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) ) return false; if ( !empty($id_or_email->user_id) ) { $id = (int) $id_or_email->user_id; $user = get_userdata($id); if ( $user) $email = $user->user_email; } if ( $email === '' && !empty($id_or_email->comment_author_email) ) { $email = $id_or_email->comment_author_email; }