$current_user=wp_get_current_user();
Statistics: Posted by Jason Caldwell — October 27th, 2010, 2:22 am
<?php
$current_user = wp_get_current_user();
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 />';
?>
Statistics: Posted by KirkWard — October 26th, 2010, 8:50 pm
Statistics: Posted by Dr Dave — October 26th, 2010, 8:24 pm
$current_user=wp_get_current_user();
Statistics: Posted by arwyl — October 26th, 2010, 6:33 pm
wp_get_current_user()
<?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 />';
?>
Statistics: Posted by KirkWard — October 26th, 2010, 1:44 pm