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

eMember – Retrieve member data without being logged in as member?

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › eMember – Retrieve member data without being logged in as member?

Tagged: custom field value

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 7 months ago by admin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 19, 2014 at 2:19 pm #11805
    Ralph12
    Member

    Hi,

    For a check, based on a custom field value, I use the following code:

    $emember_auth = Emember_Auth::getInstance();
    $verification_id = $emember_auth->getUserInfo('Verification_ID');
    if (!empty($_GET['cid']) && $_GET['cid'] == $verification_id) {
    //Display post's comment form.
    }

    It works, but then I realized it only works with logged in members. While it should work for non-logged in users as well.

    Each member also has a custom eMember field, containing a unique WP post ID. So I could retrieve the Verification ID, based on the ID of the post a user is currently viewing/reading. Something like this:

    $emember_auth = Emember_Auth::getInstance(POST_ID);
    $verification_id = $emember_auth->getUserInfo('Verification_ID');
    if (!empty($_GET['cid']) && $_GET['cid'] == $verification_id) {
    //Display post's comment form.
    }

    But there’s a problem: getInstance() doesn’t take any arguments (e.g. current post’s ID).

    Does someone know how to retrieve specific custom field values, even when there’s no logged in user? Do I have to write a SQL query for that or can I use an already existing eMember function?

    Thanks in advance.

    Best,

    Ralph

    November 19, 2014 at 11:22 pm #66901
    admin
    Keymaster

    You can call a function to retrieve data of a member (given you know the member ID).

    Here is an example snippet of code that will retrieve the email address of the member whose ID is 2:

    $user_email = wp_emember_get_user_details_by_id('email', '2');

    There are also shortcodes for this. See explanation in the following post:

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

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