Adding attributes to wordpress user profiles
Peter Mumford# 6 months, 1 week ago
I have authentication in a WordPress multisite network in a corporate intranet with miniOrange LDAP/Active Directory Login for Intranet Sites. I have domain mapping set up to map email, first name, last name. WordPress saves these values to users’ profiles.
I also map to some other attributes: company, and primarygroupid. These attributes happen to be available from the LDAP server. When I login, I can see these values in my own user profile, under Extra Profile Information.
Yet when I get my profile using the wordpress function
get_user_meta(), the extra information is not attached to my profile. How can I add the Extra Profile Information to WordPress’ user profiles?Peter Mumford
I’m trying to login, and respond to this reply, but I can’t find a login link. Did the interface change? And I can’t upload screenshots, either.Peter Mumford
P.S. the plugin version is 21.1.2,
Thanks for sending the plugin version.
As you said you can see extra attributes on the profile page, can you tell me where you do not see the attributes (please attach screenshot)? Are you trying to use
Can you please explain the issue with screenshots. You can upload screenshots to Dropbox or other file sharing service and share the link.
I sent an email with some screenshots.
I can retrieve information about a user with
get_user_meta(), or I can use
$user = new WP_User($id). They give different sets of information. But the ‘extra’ attributes are not saved to the user profile anywhere.
We have received your email and now understand the issue.
Right now additional profile attributes are visible to the user only and not admin.
If you login with any WordPress user (other than admin), and go to profile page of the logged in user you should be able to see the additional attributes.
Do you also need to have them visible from the Admin dashboard?
I want to save the extra attributes to the User Profile. The point is that if a user is from a specific business group, and the user is logged in, I can customize the content of the site for that user.# 5 months, 4 weeks ago
We already save the user attributes in the user profile (user_meta table).
You should be able to retrieve custom attributes with the code below.
$customAttribute1 = get_user_meta( $user_id, 'custom_attr1_key', true); $customAttribute2 = get_user_meta( $user_id, 'custom_attr2_key', true);
Using retrieved attributes or groups you can customize the content you want to show to the users.
Let me know in case you have any questions.