如何在 Buddypress 中获取用户名/显示名称?
问题描述:
在buddypress默认模板中,发布了某个活动的用户名显示如下:bp_activity_action();
但这不仅仅是用户名.有没有更简单的方法来获取用户对象/名称?
In buddypress default tempalte, username who has posted a certain activity is displayed like this:
bp_activity_action();
But that brings much more than just the username. Is there a simpler way to get the user object/name ?
Wordpess 获取用户数据功能不起作用,因为它显示页面作者,而不是评论或活动作者姓名.
Wordpess get userdata function doesn't work, as it displays the page author, not the comment or activity author name.
答
您有显示名称使用以下功能:
You have Display name use below function:
bp_get_displayed_user_fullname()
或
显示用户名:
bp_core_get_username($user_id)