- This topic has 3 replies, 3 voices, and was last updated 9 years, 6 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › Name of eMember array for logged-in user?
Tagged: data, member data, members
Is there a way to see what variables are currently assigned to a logged-in eMember user from PHP?
Perhaps something like:
<START_PseudoCode>
<?php
include_once(“wp-config.php”);
$MyUserInfo = getEmemberUserInfo();
print “
";
print_r($MyUserInfo);
print "
“;
?>
</END_PseudoCode>
Dave
I have tried several snippets based on PHP examples in the first of the two posts mentioned (above), but I’m obviously missing something important because it always reports “not logged in”.
My best effort is as follows:
<?php
include_once(“wp-config.php”);
global $auth;
$field_name = ‘user_name’;
$value = wp_eMember_get_user_details($field_name);
echo ‘Your username is: ‘ . $value ;
?>
TIA.
Dave
How have you structured this script? Is is part of your WordPress environment or is it just a standalone PHP script? You can’t call functions from the WordPress environment unless is code is part of a plugin or theme’s functions.php file.