Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2011 01:24:47 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Use bp_loggedin_user_id() rather than reference the $bp->logged_user->id global var directly. Second step at consolidating user ID checks to use WP_User class later. See #3738.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends/bp-friends-classes.php

    r5301 r5302  
    127127
    128128        if ( !$user_id )
    129             $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id;
     129            $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
    130130
    131131        /* This is stored in 'total_friend_count' usermeta.
     
    148148
    149149        if ( !$user_id )
    150             $user_id = $bp->loggedin_user->id;
     150            $user_id = bp_loggedin_user_id();
    151151
    152152        $filter = like_escape( $wpdb->escape( $filter ) );
     
    210210        global $wpdb, $bp;
    211211
    212         return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", bp_core_current_time(), $friendship_id, $bp->loggedin_user->id ) );
     212        return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", bp_core_current_time(), $friendship_id, bp_loggedin_user_id() ) );
    213213    }
    214214
     
    216216        global $wpdb, $bp;
    217217
    218         return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND friend_user_id = %d", $friendship_id, $bp->loggedin_user->id ) );
     218        return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND friend_user_id = %d", $friendship_id, bp_loggedin_user_id() ) );
    219219    }
    220220
Note: See TracChangeset for help on using the changeset viewer.