I want to display the user names by the reference of user id.
Is there any function like get_user_displaynme($userid)?
(and one more Is there any shortcode to get group names?)
Thanks in Advance
I want to display the user names by the reference of user id.
Is there any function like get_user_displaynme($userid)?
(and one more Is there any shortcode to get group names?)
Thanks in Advance
You can use the very same get_userdata
function of WordPress to code a specific function. Stick this in your functions.php
:
function get_display_name($user_id) {
if (!$user = get_userdata($user_id))
return false;
return $user->data->display_name;
}
So you can do something like:
$display_name = get_display_name($some_user_id);
echo $display_name;