Changeset 8514 for trunk/src/bp-friends/bp-friends-functions.php
- Timestamp:
- 06/14/2014 06:49:55 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-functions.php
r8173 r8514 196 196 * Get the friendship status of two friends. 197 197 * 198 * Will return 'is_friends', 'not_friends', or 'pending'.198 * Will return 'is_friends', 'not_friends', 'pending' or 'awaiting_response'. 199 199 * 200 200 * @param int $user_id ID of the first user. … … 203 203 */ 204 204 function friends_check_friendship_status( $user_id, $possible_friend_id ) { 205 global $members_template; 206 207 // check the BP_User_Query first 208 // @see bp_friends_filter_user_query_populate_extras() 209 if ( ! empty( $members_template->in_the_loop ) ) { 210 if ( isset( $members_template->member->friendship_status ) ) { 211 return $members_template->member->friendship_status; 212 213 // make sure that the friends BP_User_Query was registered before assuming 214 // status as 'not_friends' 215 } elseif ( has_filter( 'bp_user_query_populate_extras', 'bp_friends_filter_user_query_populate_extras' ) ) { 216 return 'not_friends'; 217 } 218 } 219 205 220 return BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id ); 206 221 }
Note: See TracChangeset
for help on using the changeset viewer.