I haven’t tried this but you could try doing something like this:
function venutius_display_member_role() {
global $members_template;
// This is a confirmed group member.
if ( $members_template->member->is_confirmed )
echo '<p>Member</p>';
// This is a group moderator.
if ( $members_template->member->is_mod )
echo '<p>Mod</p>';
// This is a group admin.
if ( $members_template->member->is_admin )
echo '<p>Admin</p>';
}
add_action( 'bp_directory_groups_item', 'venutius_display_member_role' );
I added it to the Members.php file but it seems to have no effect.
I added it to the Members.php file but it seems to have no effect.
This should actually go in your theme’s functions.php file.
Ah ok, my bad.
I’ve moved it to functions but again it’s not doing anything
This will work, I’ve used the right hook this time, and tested myself to make sure it’s working:
function venutius_display_member_role() {
global $members_template;
// This is a confirmed group member.
if ( $members_template->member->is_confirmed )
echo '<p>Member</p>';
// This is a group moderator.
if ( $members_template->member->is_mod )
echo '<p>Mod</p>';
// This is a group admin.
if ( $members_template->member->is_admin )
echo '<p>Admin</p>';
}
add_action( 'bp_group_members_list_item_action', 'venutius_display_member_role' );
Yep that works! Thanks a lot!