Gonna serve default avatars from gravatar. see #5775
git-svn-id: https://develop.svn.wordpress.org/trunk@6749 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b0a8da663d
commit
a132f8d9a6
Binary file not shown.
Before Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 787 B |
Binary file not shown.
Before Width: | Height: | Size: 920 B |
Binary file not shown.
Before Width: | Height: | Size: 1015 B |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
|
@ -1189,17 +1189,11 @@ function get_avatar( $id_or_email, $size = '96', $default = '' ) {
|
||||||
$email = $id_or_email;
|
$email = $id_or_email;
|
||||||
}
|
}
|
||||||
|
|
||||||
$default_sizes = array(16, 32, 48, 96, 128);
|
if ( empty($default) )
|
||||||
if ( empty($default) ) {
|
$default = 'http://www.gravatar.com/avatar.php?gravatar_id=' . md5('unknown@gravatar.com') . "&size=$size";
|
||||||
if ( in_array($size, $default_sizes) )
|
$default = urlencode( $default );
|
||||||
$default = trailingslashit(get_bloginfo('wpurl')) . "wp-includes/images/avatar/unknown-$size.jpg";
|
|
||||||
else
|
|
||||||
$default = trailingslashit(get_bloginfo('wpurl')) . "wp-includes/images/avatar/unknown-96.jpg";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !empty($email) ) {
|
if ( !empty($email) ) {
|
||||||
$default = urlencode( $default );
|
|
||||||
|
|
||||||
$out = 'http://www.gravatar.com/avatar.php?gravatar_id=';
|
$out = 'http://www.gravatar.com/avatar.php?gravatar_id=';
|
||||||
$out .= md5( $email );
|
$out .= md5( $email );
|
||||||
$out .= "&size={$size}";
|
$out .= "&size={$size}";
|
||||||
|
|
Loading…
Reference in New Issue