function follow_deleted( $user_id ) {
global $wpdb, $bp;
$wpdb->query( $wpdb->prepare( “DELETE FROM {$bp->follow->table_name} WHERE leader_id = %d”, user_id ) );
$wpdb->query( $wpdb->prepare( “DELETE FROM {$bp->follow->table_name} WHERE follower_id = %d”, user_id ) );
}
add_action( ‘wpmu_delete_user’, ‘follow_deleted’ );
add_action( ‘delete_user’, ‘follow_deleted’ );
add_action( ‘make_spam_user’, ‘follow_deleted’ )
I am trying to do the same thing as @iintense
@phartes – I don’t understand your reply
I am just trying to get a list of the names of the people a user is following / is followed by
Basically what you need to do is create a new BP members loop using bp_has_members(), and filter it so that it returns only the followers / following members. Below is what I am using on my site to return user following avatars.
`
`
@drebabels could you walk me through which files to edit etc?
@henry the code should go into one of your template files (i.e. if you want the followers to appear in your sidebar then you should add the code to sidebar.php). This Buddypress Follower Loop work the same way as WordPress ones do.
@henrypwmoulton the code should go into one of your template files (i.e. if you want the followers to appear in your sidebar then you should add the code to sidebar.php). This Buddypress Follower Loop work the same way as WordPress ones do.
@drebabels, on your site where exactly do you use that on your site?
It is not possible for civilization to flow backward while there is youth in the world
The very first law in advertising is to avoid the concrete promise and cultivate the delightfully vague
)
@drebabels Hello !
Everything works well but I can’t get the number of followers or following…
Is there something wrong ?
Thanks for your help !