Function to get url for UsersWP avatar

This topic contains 3 replies, has 3 voices, and was last updated by  Aaron 5 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #5965

    Aaron
    Free User
    Post count: 9

    Do we have a function to fetch the URL for the current user’s avatar?

    With Buddypress, I used to get the URL for the current user’s avatar like this:

    $chat_picture_url = bp_core_fetch_avatar(array('item_id'=>$user_obj->ID, 'html'=>false));

    I tried using get_avatar_url() but that gives me the gravatar (I don’t want that) instead of the UsersWP avatar.

    I realize that there is shortcode available to display the UsersWP avatar, but I need to get the actual URL so I can supply it to another plugin I use.

    I apologize if I overlooked this subject in the support forum; I think I searched thoroughly.

    #5966

    Guust
    Moderator
    Post count: 29970

    I’ll get the developers to have a look at your question after the weekend.
    Thanks

    #5971

    Alex Rollin
    Moderator
    Post count: 27815

    The latest version of UWP has a shortcode for that:

    
    
    
    [uwp_user_avatar tag="p" size="50"]
    

    Use the shortcode builder to see additional parameters. It can be found on any classic editor page.

    #5990

    Aaron
    Free User
    Post count: 9

    I apologize, get_avatar_url() works. I had the parameter incorrect. All is well.

    Thanks and you guys are awesome. UsersWP is the best.

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket