Re: All site data visible to members and non-members alike
I’ve submitted a ticket for the issue of wp-login not being registered as a root_component:
https://trac.buddypress.org/ticket/2074
There’s a patch attached to that ticket, to make the necessary changes to bp-core.php
And here’s my revision of the lockout plugin:
<?php
/*
Plugin Name: BuddyPress Lockdown
Plugin URI: https://buddypress.org/
Description: Lock down your BuddyPress site if a user is not logged in.
Author: Andy Peatling & Andrew_S1
Version: 1.1
Author URI: https://buddypress.org/
Site Wide Only: true
*/
function bp_lockdown() {
global $bp;
if ( BP_REGISTER_SLUG != $bp->current_component &&
BP_LOGIN_SLUG != $bp->current_component &&
BP_LOGIN1_SLUG != $bp->current_component &&
!is_user_logged_in() ) {
bp_core_redirect( site_url( BP_LOGIN_SLUG ) );
}
}
add_action( 'bp_init', 'bp_lockdown');
?>