Friday, November 5, 2010

wp_users table in the database

<?php get_userdata(userid); ?>

The call to get_userdata() returns the user's data, where it can be retrieved using member variables.

<?php $user_info = get_userdata(1);
echo('Username: ' . $user_info->user_login . "\n");
echo('User level: ' . $user_info->user_level . "\n");
echo('User ID: ' . $user_info->ID . "\n");
?>


Output:
Username: admin
User level: 10
User ID: 1
http://codex.wordpress.org/Function_Reference/get_userdata

No comments:

Post a Comment