BP_Groups_Member::get_membership_ids_for_user( int $user_id )

Get all membership IDs for a user.

Parameters Parameters


(int) (Required) ID of the user.

Top ↑

Return Return


Source Source

File: bp-groups/classes/class-bp-groups-member.php

	public static function get_membership_ids_for_user( $user_id ) {
		global $wpdb;

		$bp = buddypress();

		$group_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d ORDER BY id ASC", $user_id ) );

		return $group_ids;

Top ↑

Changelog Changelog

Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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