Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save champsupertramp/45cc47f4d5fe67cf739b to your computer and use it in GitHub Desktop.
Save champsupertramp/45cc47f4d5fe67cf739b to your computer and use it in GitHub Desktop.
<?php
/***
*** @Get user avatar uri
***/
// Call ultimatemember global variable
global $ultimatemember;
$user_id = 1;
// Set user ID
$ultimatemember->user->set( $user_id );
// Returns current user avatar
$avatar_uri = um_get_avatar_uri( um_profile('profile_photo'), 32 );
// Returns default UM avatar, e.g. https://ultimatemember.com/wp-content/uploads/2015/01/default_avatar.jpg
$default_avatar_uri = um_get_default_avatar_uri();
?>
@Doc55
Copy link

Doc55 commented Oct 14, 2021

This is working great. Thank you.
However, if a user signs up using Social Log In this doesn't show their profile photo. Even though their social media profile is showing as their profile photo in UM account. I'm not sure how to fix that.
Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment