Access User Info from outside WP?
I’d like to get the User Info on an external (non-WP) PHP page, but it doesn’t seem to be working.
I have this in my header:
And then this later on in the page:
<?php global $userdata;
echo(‘Username: ‘ . $userdata->user_login . ‘\n’);
echo(‘User level: ‘ . $userdata->user_level . ‘\n’);
echo(‘User ID: ‘ . $userdata->ID . ‘\n’);
I’m logged in, but when I go to this external page, it doesn’t show me the user info. What am I missing?
- The topic ‘Access User Info from outside WP?’ is closed to new replies.