mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 18:32:23 +01:00
Gonna serve default avatars from gravatar. see #5775
git-svn-id: http://svn.automattic.com/wordpress/trunk@6749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
36a651ef92
commit
596f6b0583
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
Block a user