Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Securing components from non logged in users


peterverkooijen
Participant

@peterverkooijen

OK, I think I get it, I’ve added this as bp-custom.php to mu-plugins:

\'<?

function oci_restrict_access(){

global $bp, $bp_unfiltered_uri;

if (!is_user_logged_in() &&

(BP_MEMBERS_SLUG == $bp_unfiltered_uri[0] ||

BP_GROUPS_SLUG == $bp->current_component )){

bp_core_redirect( $bp->root_domain );

}

}

add_action( \’wp\’, \’oci_restrict_access\’, 3 );

?>\’

It works great for the the groups section, but does nothing for the members section.

It’s also not entirely clear to me how to add the error message. Can someone put the whole thing together?

Skip to toolbar