I'm trying to make a shortcode for displaying logged in user avatar from buddypress
// user avtar
function user_avatar() {
$user_avatar_url = bp_loggedin_user_avatar('type=full&html=false');
$user_image = '<img src="' . $user_avatar_url . '"/>';
return $user_image;
}
add_shortcode('avatar', 'user_avatar');
but when I try to insert shortcode [avatar], the HTML output looks like this:
http://localhost/.../images/bp_default_avatar.jpg <img src=""></img>
Somehow image url/src appears before 'img' tag?