Skip to:
Content

BuddyPress.org

Changeset 11418


Ignore:
Timestamp:
02/08/2017 05:12:29 PM (8 years ago)
Author:
offereins
Message:

Remove duplicate code in BP_Core_User

Deduplicates fetching the user last activity in the get_user_extras()
method.

Props dcavins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-core-user.php

    r11101 r11418  
    724724        }
    725725
    726         if ( 'active' != $type ) {
    727             $user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) );
    728             for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
    729                 foreach ( (array) $user_activity as $activity ) {
    730                     if ( $activity->id == $paged_users[$i]->id )
    731                         $paged_users[$i]->last_activity = $activity->last_activity;
    732                 }
    733             }
    734         }
    735 
    736726        // Fetch the user's last_activity.
    737727        if ( 'active' != $type ) {
Note: See TracChangeset for help on using the changeset viewer.