Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save champsupertramp/908dd5c591eda65071f9 to your computer and use it in GitHub Desktop.
Save champsupertramp/908dd5c591eda65071f9 to your computer and use it in GitHub Desktop.
Ultimate Member - Get meta data
<?php
//Last Login
um_fetch_user( $user_id );
echo um_user("last_login");
// Last Active
global $um_online;
$users = $um_online->get_users();
if( isset( $users[ $user_id ] ) ){
echo $users[ $user_id ]; // prints timestamp;
}
// Number of Followers
global $um_followers;
echo $um_followers->api->count_followers_plain( $user_id );
// Number of Following
global $um_followers;
echo $um_followers->api->count_following_plain( $user_id );
//Whether they've uploaded a profile photo
um_fetch_user( $user_id );
echo um_user('synced_profile_photo'); // source: Social accounts avatars
echo um_user('profile_photo'); // source: Uploaded in profile edit form
echo um_user('synced_gravatar_hashed_id'); // source: gravatar email
//Whether they've uploaded a cover photo
um_fetch_user( $user_id );
echo um_user('cover_photo');
?>
@Cbookwap
Copy link

After pasting this inside template function.php or custom plugins.

Which shortcode will I use to call them on the web? Or after pasting it will automatically show on each member profile (I mean the following and followers)

THANK YOU.

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