Adding attributes to wordpress user profiles

  • Peter Mumford
    # 6 years 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?

    Kalpesh
    Keymaster
    # 6 years ago

    Hi Peter,

    Can you send us the screenshot of your attribute mapping configuration on support@miniorange.com so that we can take a look.

    Also, please include the version of the plugin you are using.

    Thanks,
    Kalpesh

    Peter Mumford
    # 5 years, 12 months ago

    Hi,
    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
    # 5 years, 12 months ago

    P.S. the plugin version is 21.1.2,

    Thanks!

    Kalpesh
    Keymaster
    # 5 years, 12 months ago

    Hi Peter,

    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 get_user_meta() function?

    Can you please explain the issue with screenshots. You can upload screenshots to Dropbox or other file sharing service and share the link.

    Thanks,
    Kalpesh

    Peter Mumford
    # 5 years, 12 months ago

    Kalpesh,
    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.

    Kalpesh
    Keymaster
    # 5 years, 12 months ago

    Hi Peter,

    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?

    Thanks,
    Kalpesh

    Peter Mumford
    # 5 years, 12 months ago

    Kalpesh,
    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.

    Kalpesh
    Keymaster
    # 5 years, 11 months ago

    Hello Peter,

    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.

    Thanks,
    Kalpesh

    Anthony Constantinou CEO CWM FX
    # 5 years, 3 months ago

    Gaining access to such leads hence becomes a tricky process and this is where Lead Capture plugins for WordPress come in handy significantly. The following plugins will assist you in transforming the average visitor to loyal subscribers and even customers!

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.