Can't Use Wordpress Function

I was testing the Wordpress function ...
and it did not return data from the Wordpress database for the current logged in member.
Why come?
Does s2 block the function?
I used as follows, cut and pasted from the WP function reference ...
I got the text echo, but not the array data.
- Code: Select all
wp_get_current_user()
and it did not return data from the Wordpress database for the current logged in member.
Why come?
Does s2 block the function?
I used as follows, cut and pasted from the WP function reference ...
- Code: Select all
<?php
wp_get_current_user();
/**
* @example Safe usage: $current_user = wp_get_current_user();
* if ( !($current_user instanceof WP_User) )
* return;
*/
echo 'Username: ' . $current_user->user_login . '<br />';
echo 'User email: ' . $current_user->user_email . '<br />';
echo 'User level: ' . $current_user->user_level . '<br />';
echo 'User first name: ' . $current_user->user_firstname . '<br />';
echo 'User last name: ' . $current_user->user_lastname . '<br />';
echo 'User display name: ' . $current_user->display_name . '<br />';
echo 'User ID: ' . $current_user->ID . '<br />';
?>
I got the text echo, but not the array data.