Changeset 13280 for trunk/src/bp-groups/classes/class-bp-groups-group.php
- Timestamp:
- 05/18/2022 05:32:26 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-group.php
r13185 r13280 1790 1790 */ 1791 1791 public static function get_total_member_count( $group_id, $skip_cache = false ) { 1792 $ cache_key = 'total_member_count';1793 $count = groups_get_groupmeta( $group_id, $cache_key );1792 $meta_key = 'total_member_count'; 1793 $count = groups_get_groupmeta( $group_id, $meta_key ); 1794 1794 1795 1795 if ( false === $count || true === $skip_cache ) { 1796 $ members = groups_get_group_members(1796 $group_members = new BP_Group_Member_Query( 1797 1797 array( 1798 1798 'group_id' => $group_id, 1799 1799 'group_role' => array( 'member', 'admin', 'mod' ), 1800 ' type' => 'active',1800 'count' => true, 1801 1801 ) 1802 1802 ); 1803 1803 1804 $count = $members['count'] ? $members['count'] : 0; 1805 1806 groups_update_groupmeta( $group_id, $cache_key, (int) $count ); 1804 $count = $group_members->total_users; 1805 groups_update_groupmeta( $group_id, $meta_key, $count ); 1807 1806 } 1808 1807 … … 1815 1814 * @param int $group_id The ID of the group. 1816 1815 */ 1817 return (int) apply_filters( 'bp_groups_total_member_count', (int)$count, (int) $group_id );1816 return (int) apply_filters( 'bp_groups_total_member_count', $count, (int) $group_id ); 1818 1817 } 1819 1818
Note: See TracChangeset
for help on using the changeset viewer.