WordPress at a glance
filter is not described

get_avatar filter-hook . WP 2.5.0

Filters the avatar to retrieve.

Usage

add_filter( 'get_avatar', 'filter_function_name_9595', 10, 6 );
function filter_function_name_9595( $avatar, $id_or_email, $size, $default, $alt, $args ){
	// filter...

	return $avatar;
}
$avatar(string)
<img> tag for the user's avatar.
$id_or_email(mixed)
The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.
$size(int)
Square avatar width and height in pixels to retrieve.
$default(string)
URL for the default image or a default type. Accepts '404', 'retro', 'monsterid', 'wavatar', 'indenticon','mystery' (or 'mm', or 'mysteryman'), 'blank', or 'gravatar_default'.
Default: value of the 'avatar_default' option, with a fallback of 'mystery'
$alt(string)
Alternative text to use in the avatar image tag.
Default: ''
$args(array)
Arguments passed to get_avatar_data(), after processing.

Notes

  • Since 4.2.0 The $args parameter was added.

Where the hook is called

get_avatar()
wp-includes/pluggable.php 2566
return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
wp-includes/pluggable.php 2508
return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );

Where the hook is used (in WP core)

Does not used.