bp_get_group_member_section_title()

Return the group member section header while in the groups members loop.

Description

Return

(string)

Source

File: bp-groups/bp-groups-template.php

	function bp_get_group_member_section_title() {
		static $last_user_group_role_title = null;
		$user_id               = bp_get_group_member_id();
		$group_id              = bp_get_current_group_id();
		$user_group_role_title = bp_get_user_group_role_title( $user_id, $group_id );

		ob_start();

		if ( $last_user_group_role_title != $user_group_role_title ) {
			$last_user_group_role_title = $user_group_role_title; ?>
			<li class="item-entry item-entry-header">
				<?php if ( groups_is_user_admin( $user_id, $group_id ) ) {
						echo esc_html( get_group_role_label( $group_id, 'organizer_plural_label_name' ), 'buddyboss' );
					} elseif ( groups_is_user_mod( $user_id, $group_id ) ) {
						echo esc_html( get_group_role_label( $group_id, 'moderator_plural_label_name' ), 'buddyboss' );
					} elseif ( groups_is_user_member( $user_id, $group_id ) ) {
						echo esc_html( get_group_role_label( $group_id, 'member_plural_label_name' ), 'buddyboss' );
					} ?>
			</li>
		<?php }

		return ob_get_clean();
	}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.