Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

How to Retrieve and Show Specific Details of the Logged-in Member

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

  • This topic has 20 replies, 9 voices, and was last updated 10 years, 5 months ago by orjanmen.
Viewing 15 posts - 1 through 15 (of 21 total)
1 2 →
  • Author
    Posts
  • May 10, 2012 at 12:21 am #6293
    admin
    Keymaster

    Using Shortcode

    You can display particular information of the logged in member using the “wp_eMember_user_details” shortcode.

    The following example will show you how to display the logged in member’s email. The “email” parameter can be changed to any other member details attribute to show that particular info:

    [wp_eMember_user_details user_info="email"]

    More examples

    The following will show the username:

    [wp_eMember_user_details user_info="user_name"]

    The following will show the firstname:

    [wp_eMember_user_details user_info="first_name"]

    The following will show the lastname:

    [wp_eMember_user_details user_info="last_name"]

    The following will show the membership level name of this member:

    [wp_eMember_user_details user_info="user_membership_level_name"]

    The following will show the additional membership level name(s) of this member:

    [wp_eMember_user_details user_info="user_additional_membership_level_names"]

    The following will show the expiry date:

    [wp_eMember_user_details user_info="member_expiry_date"]

    Using PHP

    Use the following function to retrieve particular field value of the logged in user:

    wp_eMember_get_user_details($field_name)

    Below is an example that will retrieve the username of the logged-in member:

    $field_name = 'user_name';
    $value = wp_eMember_get_user_details($field_name);
    echo 'Your username is: ' . $value ;

    Here is another example that will retrieve the email address of the logged-in member:

    $field_name = 'email';
    $value = wp_eMember_get_user_details($field_name);
    echo 'Your email is: ' . $value ;

    Also, take a look at the following documentation which has many useful example codes:

    http://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248

    Available default field name attributes

    Below is a list of available field name attributes(excluding custom fields) that you can use with this shortcode or the PHP function:

    user_name, first_name,last_name,email,phone, address_street,address_state, address_zipcode, address_city,member_since,membership_level,account_state,home_page,

    country, gender,subscription_starts,company_name,user_membership_level_name,

    user_additional_membership_level_names,profile_picture,profile_picture_src,

    member_expiry_date.

    Showing the Details of a Particular User

    Check the following post:

    https://support.tipsandtricks-hq.com/forums/topic/how-to-retrieve-and-show-details-of-a-specific-member

    May 10, 2012 at 12:34 am #44939
    admin
    Keymaster

    Accessing Custom Fields of the Member

    If you had a custom field named “School” then you could use the following shortcode to show the value of this field:

    [wp_eMember_user_details user_info="School"]

    If you had a custom field named “Student ID” then you would use the following to show the value of this field (the space character needs to be replaced with “_”):

    [wp_eMember_user_details user_info="Student_ID"]

    May 28, 2013 at 2:18 am #44940
    admin
    Keymaster

    Accessing Custom Fields of a Member Using PHP

    If you had a custom field named “School” then you could use the following PHP code to show the value of this field:

    <?php
    $emember_auth = Emember_Auth::getInstance();
    $value = $emember_auth->getUserInfo('School');
    echo "Field Value: ".$value ;
    ?>

    If you had a custom field named “Student ID” then you would use the following to show the value of this field (the space character needs to be replaced with “_”):

    <?php
    $emember_auth = Emember_Auth::getInstance();
    $value = $emember_auth->getUserInfo('Student_ID');
    echo "Field Value: ".$value ;
    ?>

    Form Builder Addon – Accessing Custom Fields

    Below is an example PHP code for accessing custom field configured via Form Builder addon:

    <?php
    $value = wp_emember_get_user_details_by_id("custom-field-1", "135");
    echo "Custom Field 1: " . $value ;
    ?>
    June 24, 2013 at 9:54 am #44941
    silvio.boscolo
    Member

    Hello Admin, PHP script seems to work only with standard fields.

    I have a custom field named “Ruolo” but I’m not able to get his value :

    [http://www.travel-advisor.it/prove]

    Can you help me, please?

    Silvio

    June 25, 2013 at 12:34 am #44942
    admin
    Keymaster

    Please tell me what code you used on that page to retrieve the value of a user’s field. Also, are you viewing the page while logged into the site as a member? What version of eMember are you using?

    July 5, 2013 at 9:48 pm #44943
    Bjedd
    Member

    I have 2 custom fields that I want to grab and pass out to an external query. Could I use the above to do something like this?

    function get_url($request_url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $request_url);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $response = curl_exec($ch);
    curl_close($ch);
    return $response;
    ​}​

    and then a request ​:

    $request_url = 'https://mysite.com//Default.aspx?js=[customfield-info1 here]&pe=[customfieldinfo-2 here]';
    $response = get_url($request_url);

    Honestly, I’m not a PHP programmer. I researched a bit and this was the closest I could find to a solution.

    July 6, 2013 at 1:40 am #44944
    admin
    Keymaster

    Yes, you should be able to pass values to the “Default.aspx” script using the method you explained above.

    July 8, 2013 at 5:33 am #44945
    iDesignPassion
    Member

    I would like to retrieve and show a custom field input of a certain member

    [http://thedreamteammovement.com/lps/lp642653/?id=test]

    for example his id is test – and I have a custom field – AR code – and I want to display that.. regardless of them signed in or not…

    I need this custom field to show for the specified /?id=?? for anyone to see the page

    thanks

    July 8, 2013 at 7:14 am #44946
    admin
    Keymaster

    What you suggested will require some custom coding (the option explained on this post won’t do the job). You will need to develop a script/plugin that takes the username/ID from the URL query parameter and then makes a database query to retrieve the details of that user.

    We have a member profile display addon that maybe close to what you want (you can hack/tweak it maybe):

    http://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-profile-display-extended-addon-599

    February 10, 2014 at 7:01 pm #44947
    tysonbrooks
    Member

    What about if you want to get the information for a specific user, who is NOT logged in? How can you go about doing that?

    February 10, 2014 at 11:30 pm #44948
    admin
    Keymaster

    Check the URL under the “Showing the Details of a Particular User” section above and you will get your answer.

    May 3, 2014 at 10:58 pm #44949
    Mcp
    Member

    @iDesignPassion, If you read me one day.

    Have you hack or tweak the addon, or find another solution to do what you want? i’m interested about that.

    Thank you.

    May 3, 2014 at 11:20 pm #44950
    wzp
    Moderator

    @iDesignPassion was last seen 9 months ago…

    May 3, 2014 at 11:26 pm #44951
    Mcp
    Member

    I know,

    i just putted a message in a bottle just in case….

    But if in 9 month you have a more precise answer, i’m ready to read it! :)

    May 4, 2014 at 12:41 am #44952
    wzp
    Moderator

    What he wanted to do was access information of a member that wasn’t necessarily logged in. This subject has been covered in other threads:

    Pulling member info

    API – Updating A Member Account Using HTTP GET or POST

    API – Creating A Member Account Using HTTP GET or POST

    Does eMember Have a API?


    https://support.tipsandtricks-hq.com/forums/topic/how-to-retrieve-and-show-details-of-a-specific-member

    For the last thread, if you want to use PHP instead of the shortcodes, have a look at the wp_eMember_user_details_handler() function definition inside the eMember_misc_functions.php file. This function parses the shortcodes.

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 21 total)
1 2 →
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ