BP_Groups_Group::get_total_group_count()
Get a total group count for the site.
Description Description
Will include hidden groups in the count only if bp_current_user_can( ‘bp_moderate’ ).
Return Return
(int) Group count.
Source Source
File: bp-groups/classes/class-bp-groups-group.php
public static function get_total_group_count() { global $wpdb; $hidden_sql = ''; if ( !bp_current_user_can( 'bp_moderate' ) ) $hidden_sql = "WHERE status != 'hidden'"; $bp = buddypress(); return $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" ); }
Changelog Changelog
Version | Description |
---|---|
1.6.0 | Introduced. |