ahh .. I think I got it! I believe it should be an OR instead of an AND.
I also modified it a bit using some BuddyPress code and didn’t do the bp_is_register_page() check.
I’m a WordPress newbie, so please let me know if there’s something risky/incorrect in my approach. Thank you so much!
function my_forcelogin_whitelist($whitelist) {
// If user is not logged in and
if (!is_user_logged_in() &&
(
// The current page is not register or activation
bp_is_register_page() ||
bp_is_activation_page()
)
)
// list of single page URLs
$whitelist[] = site_url($_SERVER[‘REQUEST_URI’]);
return $whitelist;
}
add_filter(‘v_forcelogin_whitelist’, ‘my_forcelogin_whitelist’, 10, 1);