The filter get_avatar
will do. Note that this function is also pluggable, meaning that you can overwrite it with your own if needed.
add_filter( 'get_avatar', 'b5f_get_avatar', 10, 5 );
function b5f_get_avatar( $avatar, $id_or_email, $size, $default, $alt )
{
$avatar = '<div class="img-max-width">' . $avatar . '</div>';
return $avatar;
}
Here are the values received in each parameter:
/**
* [avatar] => <img alt='' src='http://0.gravatar.com/avatar/ETCETERA/....' class='avatar avatar-64 photo' height='64' width='64' />
* [id_or_email] => 1
* [size] => 64
* [default] => http://0.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=64
* [alt] =>
*/