Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2015 02:07:44 AM (8 years ago)
Author:
tw2113
Message:

More docs cleanup for Friends component.

See #6400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-filters.php

    r10147 r10323  
    2727    global $wpdb;
    2828
    29     // stop if user isn't logged in
     29    // Stop if user isn't logged in.
    3030    if ( ! is_user_logged_in() ) {
    3131        return;
     
    3434    $bp = buddypress();
    3535
    36     // Fetch whether or not the user is a friend of the current user
     36    // Fetch whether or not the user is a friend of the current user.
    3737    $friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids_sql} ) ) OR (initiator_user_id IN ( {$user_ids_sql} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
    3838
    39     // Keep track of members that have a friendship status with the current user
     39    // Keep track of members that have a friendship status with the current user.
    4040    $friend_user_ids = array();
    4141
    42     // The "friend" is the user ID in the pair who is *not* the logged in user
     42    // The "friend" is the user ID in the pair who is *not* the logged in user.
    4343    foreach ( (array) $friend_status as $fs ) {
    4444        $friend_id = bp_loggedin_user_id() == $fs->initiator_user_id ? $fs->friend_user_id : $fs->initiator_user_id;
     
    5757    }
    5858
    59     // The rest are not friends with the current user, so set status accordingly
     59    // The rest are not friends with the current user, so set status accordingly.
    6060    $not_friends = array_diff( $user_query->user_ids, $friend_user_ids );
    6161    foreach ( (array) $not_friends as $nf ) {
Note: See TracChangeset for help on using the changeset viewer.