[英]Use Buddypress custom fields in bbpress
I want to use the Buddypress (standard) custom fields under the avatar of the topic pages of the bbpress forum (loop-single-reply.php). 我想在bbpress论坛(loop-single-reply.php)主题页面的头像下使用Buddypress(标准)自定义字段。 The code below works perfect with the membersloop (members-loop.php) in Buddypress pages but does not work within the bbpress forum pages.
下面的代码与Buddypress页面中的membersloop(members-loop.php)完美结合,但在bbpress论坛页面中不起作用。 Any idea?
任何想法?
<?php bp_profile_field_data( array('field' => 2, 'user_id' => bp_get_member_user_id() ) ); ?>
Found it myself... I needed to call bbp_get_reply_author_id() and not bp_get_member_user_id() 自己找到了...我需要调用bbp_get_reply_author_id()而不是bp_get_member_user_id()
<?php $user_role = bp_profile_field_data( array('field' => 4, 'user_id' => bbp_get_reply_author_id() ) );
echo $user_role; ?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.