How to filter get_avatar?

The Original Poster was missing the pair priority, parameters when declaring the filter hook:

add_filter( 'get_avatar', array( $this, 'get_avatar' ), 10, 5 );

Being 5 all the parameters the callback function can use:

public function get_avatar( $avatar, $id_or_email, $size, $default, $alt )
{
    return $avatar;
}

Leave a Comment