Skip to:
Content

BuddyPress.org

Changeset 6179


Ignore:
Timestamp:
07/16/2012 04:08:02 PM (13 years ago)
Author:
boonebgorges
Message:

Introduces bp_first_activity_for_member action, and busts member count cache on it

The bp_first_activity_for_member fires when a user's last_activity meta value
is set for the very first time (typically, on login). Busting the total member
count cache on this event ensures that the active member count in the All
Members tab will always reflect the most recent count.

Fixes #4348

Location:
trunk/bp-core
Files:
2 edited

Legend:

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

    r6093 r6179  
    5555add_action( 'bp_core_process_spammer_status', 'bp_core_clear_member_count_caches' );
    5656add_action( 'bp_core_deleted_account',        'bp_core_clear_member_count_caches' );
     57add_action( 'bp_first_activity_for_member',   'bp_core_clear_member_count_caches' );
    5758
    5859/**
  • trunk/bp-core/bp-core-functions.php

    r6131 r6179  
    498498    // Get current time
    499499    $current_time = bp_core_current_time();
     500
     501    // Use this action to detect the very first activity for a given member
     502    if ( empty( $activity ) ) {
     503        do_action( 'bp_first_activity_for_member', $user_id );
     504    }
    500505
    501506    if ( empty( $activity ) || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) )
Note: See TracChangeset for help on using the changeset viewer.