Last active
December 17, 2015 16:39
-
-
Save jaredatch/5640611 to your computer and use it in GitHub Desktop.
Get a gravatar URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the gravatar URL | |
* | |
* @since 1.0.0 | |
* @param string $email | |
* @param int $size | |
* @return string | |
*/ | |
function ja_get_gravatar_url( $email, $size = '120' ) { | |
$hash = md5( strtolower( trim ( $email ) ) ); | |
$url = 'http://gravatar.com/avatar/' . $hash; | |
if ( !empty ( $size) ) | |
$url .= $url . '?s=' . $size; | |
return $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment