- This topic has 2 replies, 3 voices, and was last updated 8 years, 9 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › WP eMember – Anyway to get specific member details by wordpress user_id
I see wordpress user_id and emember_id are not matching. Is there any way to retrieve emember profile details by using wordpress user_id ?
if there is no direct way, is there a two steps process of getting member_id first for a given user_id then I can use wp_emember_get_user_details_by_id.
this is a critical piece of functionality that is missing.
Does any of this help?
I see wordpress user_id and emember_id are not matching.
And they never will. That’s because the ID are really index numbers into 2 different tables. And, because you can have systems in which the number of WordPress and eMember users are different; because they can be 2 totally different sets of people.
The username and email address values will always be the same. So you should use those to match the profiles (if you need to).
If you have the WP User ID then also have the username and email values.
You can make the following function calls which will return the eMember ID (or false if nothing is found):
$emember_id = emember_username_exists($user_name);
OR
$emember_id = emember_email_exists($email);
Alternatively, you can use the following code to retrieve the eMember profile given you know the username:
global $wpdb;
$query = $wpdb->prepare('SELECT * FROM ' . WP_EMEMBER_MEMBERS_TABLE_NAME . ' WHERE user_name=%s', $user_name);
$resultset = $wpdb->get_row($query);