BP_Groups_Member::get_group_administrator_ids( int $group_id )
Get a list of all a given group’s admins.
Description
Parameters
- $group_id
-
(Required) ID of the group.
Return
(array) Info about group admins (user_id + date_modified).
Source
File: bp-groups/classes/class-bp-groups-member.php
public static function get_group_administrator_ids( $group_id ) { global $wpdb; if ( empty( $group_id ) ) { return array(); } $group_admins = wp_cache_get( $group_id, 'bp_group_admins' ); if ( false === $group_admins ) { self::prime_group_admins_mods_cache( array( $group_id ) ); $group_admins = wp_cache_get( $group_id, 'bp_group_admins' ); } if ( false === $group_admins ) { // The wp_cache_get is still coming up empty. Return an empty array. $group_admins = array(); } else { // Cast the user_id property as an integer. foreach ( (array) $group_admins as $key => $data ) { $group_admins[ $key ]->user_id = (int) $group_admins[ $key ]->user_id; } } return $group_admins; }
Changelog
Version | Description |
---|---|
BuddyPress 1.6.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.