| [ Index ] | PHP Cross Reference of BuddyPress | 
[Source view] [Print] [Project Stats]
BuddyPress Groups Classes.
| File Size: | 1414 lines (48 kb) | 
| Included or required: | 0 times | 
| Referenced: | 0 times | 
| Includes or requires: | 0 files | 
BP_Groups_Member:: (45 methods):
  __construct()
  populate()
  __get()
  __isset()
  get_user_object()
  save()
  promote()
  demote()
  ban()
  unban()
  accept_invite()
  accept_request()
  remove()
  refresh_total_group_count_for_user()
  refresh_total_member_count_for_group()
  delete()
  get_group_ids()
  get_recently_joined()
  get_is_admin_of()
  get_is_mod_of()
  get_is_banned_of()
  total_group_count()
  get_invites()
  get_invite_count_for_user()
  get_user_memberships()
  check_has_invite()
  delete_invite()
  delete_request()
  check_is_admin()
  check_is_mod()
  check_is_member()
  check_is_banned()
  check_is_creator()
  check_for_membership_request()
  get_random_groups()
  get_group_member_ids()
  get_group_administrator_ids()
  prime_group_admins_mods_cache()
  get_group_moderator_ids()
  get_memberships_by_id()
  get_all_membership_request_user_ids()
  get_all_for_group()
  get_membership_ids_for_user()
  delete_all()
  delete_all_for_user()
Class: BP_Groups_Member - X-Ref
BuddyPress Group Membership object.| __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) X-Ref | 
| Constructor method. since: 1.6.0 param: int $user_id Optional. Along with $group_id, can be used to param: int $group_id Optional. Along with $user_id, can be used to param: int|bool $id Optional. The unique ID of the membership object. param: bool $populate Whether to populate the properties of the | 
| populate() X-Ref | 
| Populate the object's properties. since: 1.6.0 | 
| __get( $key ) X-Ref | 
| Magic getter. return: BP_Core_User|null since: 2.8.0 param: string $key Key. | 
| __isset( $key ) X-Ref | 
| Magic issetter. return: bool since: 2.8.0 param: string $key Key. | 
| get_user_object() X-Ref | 
| Get the user object corresponding to this membership. Used for lazyloading the protected `user` property. return: BP_Core_User since: 2.8.0 | 
| save() X-Ref | 
| Save the membership data to the database. return: bool True on success, false on failure. since: 1.6.0 | 
| promote( $status = 'mod' ) X-Ref | 
| Promote a member to a new status. return: bool True on success, false on failure. since: 1.6.0 param: string $status The new status. 'mod' or 'admin'. | 
| demote() X-Ref | 
| Demote membership to Member status (non-admin, non-mod). return: bool True on success, false on failure. since: 1.6.0 | 
| ban() X-Ref | 
| Ban the user from the group. return: bool True on success, false on failure. since: 1.6.0 | 
| unban() X-Ref | 
| Unban the user from the group. return: bool True on success, false on failure. since: 1.6.0 | 
| accept_invite() X-Ref | 
| Mark a pending invitation as accepted. since: 1.6.0 | 
| accept_request() X-Ref | 
| Confirm a membership request. since: 1.6.0 | 
| remove() X-Ref | 
| Remove the current membership. return: bool True on success, false on failure. since: 1.6.0 | 
| refresh_total_group_count_for_user( $user_id ) X-Ref | 
| Refresh the `total_group_count` for a user. since: 1.8.0 param: int $user_id ID of the user. | 
| refresh_total_member_count_for_group( $group_id ) X-Ref | 
| Refresh the `total_member_count` for a group. The request skip the current cache so that we always grab the lastest total count. since: 1.8.0 since: 10.0.0 Updated to use `BP_Groups_Group::get_total_member_count` param: int $group_id ID of the group. | 
| delete( $user_id, $group_id ) X-Ref | 
| Delete a membership, based on user + group IDs. return: bool True on success, false on failure. since: 1.6.0 param: int $user_id ID of the user. param: int $group_id ID of the group. | 
| get_group_ids( $user_id, $limit = false, $page = false ) X-Ref | 
| Get the IDs of the groups of which a specified user is a member. return: array { since: 1.6.0 param: int $user_id ID of the user. param: int|bool $limit Optional. Max number of results to return. param: int|bool $page Optional. Page offset of results to return. | 
| get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) X-Ref | 
| Get the IDs of the groups of which a specified user is a member, sorted by the date joined. return: array { since: 1.6.0 param: int $user_id ID of the user. param: int|bool $limit Optional. Max number of results to return. param: int|bool $page Optional. Page offset of results to return. param: string|bool $filter Optional. Limit results to groups whose name or | 
| get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) X-Ref | 
| Get the IDs of the groups of which a specified user is an admin. return: array { since: 1.6.0 param: int $user_id ID of the user. param: int|bool $limit Optional. Max number of results to return. param: int|bool $page Optional. Page offset of results to return. param: string|bool $filter Optional. Limit results to groups whose name or | 
| get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) X-Ref | 
| Get the IDs of the groups of which a specified user is a moderator. return: array { since: 1.6.0 param: int $user_id ID of the user. param: int|bool $limit Optional. Max number of results to return. param: int|bool $page Optional. Page offset of results to return. param: string|bool $filter Optional. Limit results to groups whose name or | 
| get_is_banned_of( $user_id, $limit = false, $page = false, $filter = false ) X-Ref | 
| Get the groups of which a specified user is banned from. return: array { since: 2.4.0 param: int $user_id ID of the user. param: int|bool $limit Optional. Max number of results to return. param: int|bool $page Optional. Page offset of results to return. param: string|bool $filter Optional. Limit results to groups whose name or | 
| total_group_count( $user_id = 0 ) X-Ref | 
| Get the count of groups of which the specified user is a member. return: int Group count. since: 1.6.0 param: int $user_id Optional. Default: ID of the displayed user. | 
| get_invites( $user_id, $limit = false, $page = false, $exclude = false ) X-Ref | 
| Get group objects for groups that a user is currently invited to. return: array { since: 1.6.0 param: int $user_id ID of the invitee. param: int|bool $limit Optional. Max number of results to return. param: int|bool $page Optional. Page offset of results to return. param: string|array|bool $exclude Optional. Array or comma-separated list | 
| get_invite_count_for_user( $user_id = 0 ) X-Ref | 
| Gets the total group invite count for a user. return: int since: 2.0.0 param: int $user_id The user ID. | 
| get_user_memberships( $user_id, $args = array() X-Ref | 
| Gets memberships of a user for purposes of a personal data export. return: array since: 4.0.0 param: int $user_id ID of the user. param: array $args { | 
| check_has_invite( $user_id, $group_id, $type = 'sent' ) X-Ref | 
| Check whether a user has an outstanding invitation to a given group. return: int|null The ID of the invitation if found; null if not found. since: 1.6.0 param: int $user_id ID of the potential invitee. param: int $group_id ID of the group. param: string $type If 'sent', results are limited to those invitations | 
| delete_invite( $user_id, $group_id, $inviter_id = false ) X-Ref | 
| Delete an invitation, by specifying user ID and group ID. return: int Number of records deleted. since: 1.6.0 param: int $user_id ID of the user. param: int $group_id ID of the group. param: int $inviter_id ID of the inviter. Specify if you want to delete | 
| delete_request( $user_id, $group_id ) X-Ref | 
| Delete an unconfirmed membership request, by user ID and group ID. return: int Number of records deleted. since: 1.6.0 param: int $user_id ID of the user. param: int $group_id ID of the group. | 
| check_is_admin( $user_id, $group_id ) X-Ref | 
| Check whether a user is an admin of a given group. return: mixed since: 1.6.0 param: int $user_id ID of the user. param: int $group_id ID of the group. | 
| check_is_mod( $user_id, $group_id ) X-Ref | 
| Check whether a user is a mod of a given group. return: mixed since: 1.6.0 param: int $user_id ID of the user. param: int $group_id ID of the group. | 
| check_is_member( $user_id, $group_id ) X-Ref | 
| Check whether a user is a member of a given group. return: mixed since: 1.6.0 param: int $user_id ID of the user. param: int $group_id ID of the group. | 
| check_is_banned( $user_id, $group_id ) X-Ref | 
| Check whether a user is banned from a given group. return: int|null int 1 if user is banned; int 0 if user is not banned; since: 1.6.0 param: int $user_id ID of the user. param: int $group_id ID of the group. | 
| check_is_creator( $user_id, $group_id ) X-Ref | 
| Is the specified user the creator of the group? return: int|null int of group ID if user is the creator; null on failure. since: 1.2.6 param: int $user_id ID of the user. param: int $group_id ID of the group. | 
| check_for_membership_request( $user_id, $group_id ) X-Ref | 
| Check whether a user has an outstanding membership request for a given group. return: int Database ID of the membership if found; int 0 on failure. since: 1.6.0 param: int $user_id ID of the user. param: int $group_id ID of the group. | 
| get_random_groups( $user_id = 0, $total_groups = 5 ) X-Ref | 
| Get a list of randomly selected IDs of groups that the member belongs to. return: array Group IDs. since: 1.6.0 param: int $user_id ID of the user. param: int $total_groups Max number of group IDs to return. Default: 5. | 
| get_group_member_ids( $group_id ) X-Ref | 
| Get the IDs of all a given group's members. return: array IDs of all group members. since: 1.6.0 param: int $group_id ID of the group. | 
| get_group_administrator_ids( $group_id ) X-Ref | 
| Get a list of all a given group's admins. return: array Info about group admins (user_id + date_modified). since: 1.6.0 param: int $group_id ID of the group. | 
| prime_group_admins_mods_cache( $group_ids ) X-Ref | 
| Prime the bp_group_admins cache for one or more groups. return: bool True on success. since: 2.7.0 param: array $group_ids IDs of the groups. | 
| get_group_moderator_ids( $group_id ) X-Ref | 
| Get a list of all a given group's moderators. return: array Info about group mods (user_id + date_modified). since: 1.6.0 param: int $group_id ID of the group. | 
| get_memberships_by_id( $membership_ids ) X-Ref | 
| Get group membership objects by ID (or an array of IDs). return: array since: 2.6.0 param: int|string|array $membership_ids Single membership ID or comma-separated/array list of membership IDs. | 
| get_all_membership_request_user_ids( $group_id ) X-Ref | 
| Get the IDs users with outstanding membership requests to the group. return: array IDs of users with outstanding membership requests. since: 1.6.0 param: int $group_id ID of the group. | 
| get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) X-Ref | 
| Get members of a group. return: false|array param: int $group_id ID of the group being queried for. param: bool|int $limit Max amount to return. param: bool|int $page Pagination value. param: bool $exclude_admins_mods Whether or not to exclude admins and moderators. param: bool $exclude_banned Whether or not to exclude banned members. param: bool|array $exclude Array of user IDs to exclude. | 
| get_membership_ids_for_user( $user_id ) X-Ref | 
| Get all membership IDs for a user. return: array since: 2.6.0 param: int $user_id ID of the user. | 
| delete_all( $group_id ) X-Ref | 
| Delete all memberships for a given group. return: int Number of records deleted. since: 1.6.0 param: int $group_id ID of the group. | 
| delete_all_for_user( $user_id ) X-Ref | 
| Delete all group membership information for the specified user. In cases where the user is the sole member of a group, a site administrator is assigned to be the group's administrator. Unhook `groups_remove_data_for_user()` to modify this behavior. return: bool since: 1.0.0 since: 4.0.0 The method behavior was changed so that single-member groups are not deleted. param: int $user_id ID of the user. | 
| Generated: Fri Oct 31 01:00:56 2025 | Cross-referenced by PHPXref 0.7.1 |