Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Redirect to Registration Page [“Plugin”]


21cdb
Participant

@21cdb

Just figured out the solution. I forgot to exclude BP_REGISTER_SLUG from (!is_logged_in):

This solution works for me (put it in bp-custom.php)

function restrict_access() {

global $bp, $bp_unfiltered_uri;

if (!is_user_logged_in() && (BP_REGISTER_SLUG != $bp->current_component )) {

//bp_core_redirect( $bp->root_domain );
bp_core_redirect( $bp->root_domain . '/' . BP_REGISTER_SLUG );

}
}

add_action( 'wp', 'restrict_access', 3 );

Skip to toolbar