<?php
/**
* @author mircobabini
* @uses get_avatar_url: https://gist.github.com/mircobabini/4d6e129789652e6ac06b
* @requires https://wordpress.org/plugins/wp-user-avatar/
*/
function get_user_avatar_url( $user, $full = false ){
$attachment_id = get_user_meta( $user->ID, 'wp_user_avatar', true );
if( $attachment_id ){
return ( $full ) ?
wp_get_attachment_url( $attachment_id ) :
wp_get_attachment_thumb_url( $attachment_id );
}
return get_avatar_url( $user->ID );
}