I'm trying to print a user's picture without the link to the user's profile which is what theme('user_picture', array('account' =>$user_item)) will render. If I use image_style_url('thumbnail', $user->picture->uri) the Gravatar hook will not be called.
So far the only way I have found to do this is:
if (function_exists('_gravatar_get_account_user_picture')) {
$picture = _gravatar_get_account_user_picture($user);
} else {
$picture = $user->picture->uri;
}
if (file_valid_uri($picture)) {
$picture = image_style_url('thumbnail', $picture);
}
But this isn't very elegant, especially since I am developing a module and I'd rather not have to explicitly call the Gravatar module.
Any suggestions?
Thanks!