Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/13/2014 11:45:17 AM (10 years ago)
Author:
boonebgorges
Message:

Introduce tool on Tools menu for repairing last_activity data

Fixes #5461

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-tools.php

    r8117 r8124  
    9696 */
    9797function bp_admin_repair_list() {
     98    $repair_list = array();
     99
    98100    // Members:
    99101    // - member count
    100     $repair_list = array(
    101         20 => array(
    102             'bp-total-member-count',
    103             __( 'Count total members', 'buddypress' ),
    104             'bp_admin_repair_count_members',
    105         ),
     102    // - last_activity migration (2.0)
     103    $repair_list[20] = array(
     104        'bp-total-member-count',
     105        __( 'Count total members', 'buddypress' ),
     106        'bp_admin_repair_count_members',
     107    );
     108
     109    $repair_list[25] = array(
     110        'bp-last-activity',
     111        __( 'Repair user "last activity" data', 'buddypress' ),
     112        'bp_admin_repair_last_activity',
    106113    );
    107114
     
    241248    delete_transient( 'bp_active_member_count' );
    242249    bp_core_get_active_member_count();
     250    return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
     251}
     252
     253/**
     254 * Repair user last_activity data.
     255 *
     256 * Re-runs the migration from usermeta introduced in BP 2.0.
     257 *
     258 * @since BuddyPress (2.0.0)
     259 */
     260function bp_admin_repair_last_activity() {
     261    $statement = __( 'Determining last activity dates for each user… %s', 'buddypress' );
     262    bp_last_activity_migrate();
    243263    return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
    244264}
Note: See TracChangeset for help on using the changeset viewer.