Something similar to:
$user = get_userdata( $user_id );
if ( !empty( $user->user_nicename ) ) {
$user_nicename = $user->user_nicename;
}
…should do it. You’ll need to sort out the context of how to get the $user_id though.
First of all, thank you for your help.
Now, I came up with…
$user = get_userdata( bbp_reply_author_id() );
if ( !empty( $user->user_nicename ) ) {
$user_nicename = $user->user_nicename;
}
… but it returns the user ID number, not the nicename. Any further thoughts?
Geesh, sorry for all the edits but I guess I don’t get your insert code thing. Anyway I used bbp reply author id to pull the id but this all together returns just that, the author id number. Any further ideas?
Because bbp_reply_author_id() does not return, it echo’s.
Use bbp_get_reply_author_id() instead. It will return a value.
get functions always return, their counterparts always echo.
Thank you, John. I swapped those and it returned nothing. But when I added an echo to actually display the value it works as I wished for it too, so thank you for your help!
Hello Foks
@goodintoday or somebody else can tell me exactly the code and where to apply it to show the @username with the creator of the post