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.

Parameters Parameters


(int) (Required) ID of the user.


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


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

Top ↑

Return Return


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

Source 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 );

Top ↑

Changelog Changelog

Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.