Changeset 3044
- Timestamp:
- 06/11/2010 01:01:46 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-friends/bp-friends-classes.php
r2976 r3044 316 316 global $wpdb, $bp; 317 317 318 // Get friends of $user_id 319 $friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id ); 320 318 321 // Delete all friendships related to $user_id 319 322 $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE friend_user_id = %d OR initiator_user_id = %d", $user_id, $user_id ) ); … … 322 325 $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE component_name = 'friends' AND ( component_action = 'friendship_request' OR component_action = 'friendship_accepted' ) AND item_id = %d", $user_id ) ); 323 326 324 // Get friends of $user_id and update their respective friend counts 325 $friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id ); 326 foreach ( (array)$friend_ids as $friend_id ) 327 // Loop through friend_ids and update their counts 328 foreach ( (array)$friend_ids as $friend_id ) { 327 329 BP_Friends_Friendship::total_friend_count( $friend_id ); 328 330 } 329 331 } 330 332 }
Note: See TracChangeset
for help on using the changeset viewer.