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 get member id and his details (retrieve member details)

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember F.A.Q/Instructions › How to get member id and his details (retrieve member details)

Tagged: member details, member id, retrieve member details

  • This topic has 8 replies, 6 voices, and was last updated 10 years, 10 months ago by admin.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • August 11, 2010 at 1:37 pm #1667
    mudit.agarwal
    Member

    Hi,

    Is there a way, first to check whether user is logged in or not.. If yes than his member id?

    Do we have any shortcode OR php code for this?

    August 12, 2010 at 12:41 am #23307
    amin007
    Participant

    Update: You can now use the method explained here to access and show any details of the logged-in member:

    https://support.tipsandtricks-hq.com/forums/topic/how-to-retrieve-and-show-a-particular-info-of-the-logged-in-member


    Here is an example code that lets you find out if a member is logged in and what his membership ID and level is:

    global $auth;
    $user_id = $auth->getUserInfo('member_id');
    if (!empty($user_id))
    {
    //User is logged in so add your conditional code here
    $membership_level = $auth->getUserInfo('membership_level');
    if($membership_level == 1)
    {
    //Add stuff for this level
    }
    }

    There are more examples here:

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

    November 9, 2010 at 2:47 am #23308
    amin007
    Participant

    This is how you can get the name of a logged in user:

    global $auth;
    $user_id = $auth->getUserInfo('member_id');
    if (!empty($user_id))
    {
    //User is logged in so you can display the name
    $first_name = $auth->getUserInfo('first_name');
    $last_name = $auth->getUserInfo('last_name');
    echo "Hello ".$first_name." ".$last_name;
    }

    February 11, 2011 at 3:00 pm #23309
    Tuttie
    Member

    woops! posted in the wrong one.

    edited

    August 7, 2011 at 1:04 pm #23310
    Sylvie
    Member

    Is there a shortcode to display name and membership level

    I have install a member dashboard and I would like to have their name and memberhsip level display on the page.

    Thanks

    August 7, 2011 at 11:50 pm #23311
    amin007
    Participant

    You can use the following shortcodes to display the first and last name

    [wp_eMember_first_name]
    [wp_eMember_last_name]

    There is no shortcode for membership level. This page have some example codes of how to retrieve the membership level which might help:

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

    August 9, 2011 at 2:40 am #23312
    Sylvie
    Member

    Thanks :)

    July 15, 2014 at 1:56 pm #23313
    ashishtomar
    Member

    Its not working on theme header.php file? I need to set other menu instead of default menu after login, so i need to know is_member_logged_in ?

    How can i know is_member_logged_in on theme header.php file

    July 15, 2014 at 11:15 pm #23314
    admin
    Keymaster

    The correct function name is the following:

    wp_emember_is_member_logged_in()

    Are you using that?

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • 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