如何在 Buddypress 中获取用户名/显示名称? [英] How to get username/display name in Buddypress?

查看:25
本文介绍了如何在 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)

这篇关于如何在 Buddypress 中获取用户名/显示名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆