lib/Comment.php
public function avatar( $size = 92, $default = '' ) {
		if ( !get_option('show_avatars') ) {
			return false;
		}
		if ( !is_numeric($size) ) {
			$size = '92';
		}

		$email = $this->avatar_email();

		$args = array('size' => $size, 'default' => $default);
		$args = apply_filters('pre_get_avatar_data', $args, $email);
		if ( isset($args['url']) ) {
			return $args['url'];
		}

		$email_hash = '';
		if ( !empty($email) ) {
			$email_hash = md5(strtolower(trim($email)));
		}
		$host = $this->avatar_host($email_hash);
		$default = $this->avatar_default($default, $email, $size, $host);
		if ( !empty($email) ) {
			$avatar = $this->avatar_out($default, $host, $email_hash, $size);
		} else {
			$avatar = $default;
		}
		return $avatar;
	}
public function avatar( $size = 92, $default = '' ) {
		if ( !get_option('show_avatars') ) {
			return false;
		}
		if ( !is_numeric($size) ) {
			$size = '92';
		}

		$email = $this->avatar_email();

		$args = array('size' => $size, 'default' => $default);
		$args = apply_filters('pre_get_avatar_data', $args, $email);
		if ( isset($args['url']) ) {
			return $args['url'];
		}

		$email_hash = '';
		if ( !empty($email) ) {
			$email_hash = md5(strtolower(trim($email)));
		}
		$host = $this->avatar_host($email_hash);
		$default = $this->avatar_default($default, $email, $size, $host);
		if ( !empty($email) ) {
			$avatar = $this->avatar_out($default, $host, $email_hash, $size);
		} else {
			$avatar = $default;
		}
		return $avatar;
	}
public function avatar ( $ size = 92 , $ default = '' ) { if ( ! get_option ( 'show_avatars' ) ) { return false ; } if ( ! is_numeric ( $ size ) ) { $ size = '92' ; } $ email = $ this -> avatar_email ( ) ; $ args = array ( 'size' => $ size , 'default' => $ default ) ; $ args = apply_filters ( 'pre_get_avatar_data' , $ args , $ email ) ; if ( isset ( $ args [ 'url' ] ) ) { return $ args [ 'url' ] ; } $ email_hash = '' ; if ( ! empty ( $ email ) ) { $ email_hash = md5 ( strtolower ( trim ( $ email ) ) ) ; } $ host = $ this -> avatar_host ( $ email_hash ) ; $ default = $ this -> avatar_default ( $ default , $ email , $ size , $ host ) ; if ( ! empty ( $ email ) ) { $ avatar = $ this -> avatar_out ( $ default , $ host , $ email_hash , $ size ) ; } else { $ avatar = $ default ; } return $ avatar ; }
Fetches the Gravatar
@api
@example
```twig
<img src="{{comment.avatar(36,template_uri~"/img/dude.jpg")}}" alt="Image of {{comment.author.name}}" />
```
```html
<img src="http://gravatar.com/i/sfsfsdfasdfsfa.jpg" alt="Image of Katherine Rich" />
```
@param int $size
@param string $default
@return bool|mixed|string
Fetches the Gravatar