groups_get_user_groups( int $user_id, int $pag_num, int $pag_page )

Get the IDs of the groups of which a specified user is a member.

Description

Parameters

$user_id

(int) (Required) ID of the user.

$pag_num

(int) (Optional) Max number of results to return. Default: false (no limit).

$pag_page

(int) (Optional) Page offset of results to return. Default: false (no limit).

Return

(array)

  • 'groups'
    (array) Array of groups returned by paginated query.
  • 'total'
    (int) Count of groups matching query.

Source

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

function groups_get_user_groups( $user_id = 0, $pag_num = 0, $pag_page = 0 ) {

	if ( empty( $user_id ) )
		$user_id = bp_displayed_user_id();

	return BP_Groups_Member::get_group_ids( $user_id, $pag_num, $pag_page );
}

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.