Filters the HTML for a user’s avatar.
$avatarstring
$id_or_emailmixed
$sizeint
$default_valuestring
'404' (return a 404 instead of a default image)'retro' (a 8-bit arcade-style pixelated face)'robohash' (a robot)'monsterid' (a monster)'wavatar' (a cartoon face)'identicon' (the "quilt", a geometric pattern)'mystery', 'mm', or 'mysteryman' (The Oyster Man)'blank' (transparent GIF)'gravatar_default' (the Gravatar logo)$altstring
$argsarray
size intheight intwidth intdefault string'404' (return a 404 instead of a default image)'retro' (a 8-bit arcade-style pixelated face)'robohash' (a robot)'monsterid' (a monster)'wavatar' (a cartoon face)'identicon' (the "quilt", a geometric pattern)'mystery', 'mm', or 'mysteryman' (The Oyster Man)'blank' (transparent GIF)'gravatar_default' (the Gravatar logo) Default is the value of the 'avatar_default' option, with a fallback of 'mystery'.force_default boolrating string'G' (suitable for all audiences)'PG' (possibly offensive, usually for audiences 13 and above)'R' (intended for adult audiences above 17)'X' (even more mature than above) Default is the value of the 'avatar_rating' option.scheme stringprocessed_args arrayextra_attr stringThe “get_avatar” filter can be used to alter the avatar image returned by the get_avatar() function.
There are two tricky parts to using this filter:
return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/get_avatar