Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to display the poster’s user role in forums for that specific group


r-a-y
Keymaster

@r-a-y

Sorry about that! I thought it would work. Looks like BP is missing some template tags for this.

This will work.

Add the following to your theme’s functions.php:

`
function bp_topic_poster_is_admin() {
global $topic_template;
return BP_Groups_Member::check_is_admin( $topic_template->post->poster_id, bp_get_the_topic_object_id() );
}

function bp_topic_poster_is_mod() {
global $topic_template;
return BP_Groups_Member::check_is_mod( $topic_template->post->poster_id, bp_get_the_topic_object_id() );
}`

Then use this in your template:

`if ( function_exists( ‘bp_topic_poster_is_mod’ ) ) :
if ( bp_topic_poster_is_mod() ) echo ‘Group Moderator’;
endif;`

Skip to toolbar