Snippet to make a BuddyPress social network private and force registration
Here is a little piece of code that is very useful to me in my BuddyPress sites. It allows you to make the social network private, and to access it, you must become a member.