Last active
October 19, 2021 05:10
-
-
Save enlacee/abc3a05c2380601add7eacc40c13a8a8 to your computer and use it in GitHub Desktop.
get_display_name php wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* REF | |
* https://wordpress.stackexchange.com/questions/59435/how-to-get-current-user-name-by-user-id-in-buddypress | |
*/ | |
function get_display_name($user_id) { | |
if (!$user = get_userdata($user_id)) | |
return false; | |
return $user->data->display_name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment