Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: I Need Help Writing A Custom Function to Redirect Non-Logged in Users.

Ok, I got it to work. I added this…

function sh_walled_garden()
{
global $bp;
if ( bp_is_register_page() || bp_is_activation_page() )
return;
if( ! bp_is_blog_page() && ! is_user_logged_in() )
bp_core_redirect( $bp->root_domain .’/’. BP_REGISTER_SLUG );
}
add_action( ‘walled_garden’, ‘sh_walled_garden’ );

…into /wp-content/plugins/buddypress/bp-themes/bp-default/functions.php

and added…

…into the top of /wp-content/plugins/buddypress/bp-themes/bp-default/header.php

So far, so good!

Skip to toolbar