- This topic has 20 replies, 9 voices, and was last updated 10 years ago by .
- 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 F.A.Q/Instructions › How to Retrieve and Show Specific Details of the Logged-in Member
Tagged: display member info, edit form, emember api, member data, members
Ok Thanks you again.
I will look that tomorrow.
I am using the $user_id = $auth->getUserInfo(‘member_id’); to retrieve member id and similarly for other fields in the members table, but how do I retrieve and parse a custom field that I use during registration? I have two custom field, School/Organization and Organization_code, and I need to get the value for Organization_code to set visible properties on my page, but I cannot find code that will return the value.
I see the custom fields in the wp_members_meta_tbl as serialized data in the meta_value field, but how do I retrieve those values?
Try the following:
$organization_code = $auth->getUserInfo(‘Organization_code’);
Thanks, I did try that but it didn’t work, I ended up getting the user id, pulling the meta_value and unserializing it.
Maybe I had something wrong, but I tried it several times and it never returned the code. I will attempt it again, when I’m refactoring to see if I can get it to work, it has to be a performance hit to query the db again.
The “getUserInfo” function does not query the DB. When the user authenticates, it loads the data into the auth class. The function just reads the data from the variable.
You are reading data for the currently logged in user right?
Hi.
When I use [wp_eMember_user_details user_info=”CUSTOM_FIELD_NAME”], it don’t show the whole value. It seems it only show the two first letters.
EDIT: Found my error. On Front End, Dropdown List show value before “=>”. E.g. (Number1=>Value#1, Number2=>Value#2, Number3=>Value#3). If user choose Value#2 at registration, the shortcode will show “Number2”.