Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/13/2012 04:31:51 PM (13 years ago)
Author:
boonebgorges
Message:

'Total member count' cleanup:

  • Introduces bp_core_get_active_member_count() to get an accurate count of members with recorded last_activity
  • Points bp_get_total_member_count() to bp_core_get_active_member_count(), so that 'All Members' tab count on member directories matches the total count prepared by BP_Core_User::get_users(). Fixes #4061
  • Changes 'All Members' count in activity/index.php to use bp_get_total_member_count(), for greater accuracy and consistency between activity and members components
  • Introduces a cache-busting function to be fired when member counts change (new members, spam status changed, member deleted)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-cache.php

    r5986 r5987  
    4444    wp_cache_delete( 'bp_user_' . $user_id, 'bp' );
    4545}
     46
     47/**
     48 * Clears member count caches and transients
     49 */
     50function bp_core_clear_member_count_caches() {
     51    wp_cache_delete( 'bp_total_member_count', 'bp' );
     52    delete_transient( 'bp_active_member_count' );
     53}
     54add_action( 'bp_core_activated_user',         'bp_core_clear_member_count_caches' );
     55add_action( 'bp_core_process_spammer_status', 'bp_core_clear_member_count_caches' );
     56add_action( 'bp_core_deleted_account',        'bp_core_clear_member_count_caches' );
    4657
    4758/**
Note: See TracChangeset for help on using the changeset viewer.