Last active
May 21, 2020 12:10
-
-
Save champsupertramp/908dd5c591eda65071f9 to your computer and use it in GitHub Desktop.
Ultimate Member - Get meta data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.