Hello Brajesh,
I use this code stated below to force users to follow a set of users upon registration. How can I prevent users from unfollowing this users with the stated IDs
(Users should not be able to unfollow the stated users if possible to hide the unfollow button for the stated user IDs)function auto_follow_users( $user_id ){ if ( function_exists( 'bp_follow_start_following' ) ){ // Add your user ids here $users_to_follow = array( '606', '617', '619', '608', '548' ); foreach ( $users_to_follow as $follow_user ) { bp_follow_start_following( array( 'leader_id' => $follow_user, 'follower_id' => $user_id ) ); } } } add_action('bp_core_activated_user', 'auto_follow_users', 10, 1);
I would like to hide the unfollow button across the entire site for all this users with IDs ( ‘606’, ‘617’, ‘619’, ‘608’, ‘548’ )
Marking it closed in favour of
https://buddydev.com/support/forums/topic/prevent-buddypress-unfollow-function-for-specified-users-2/- This reply was modified 6 years, 7 months ago by Brajesh Singh.
Viewing 2 posts - 1 through 2 (of 2 total)
The topic ‘ [Resolved] Prevent buddypress unfollow function for specified users’ is closed to new replies.
This topic is: resolved