Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter vargh3se

    (@vargh3se)

    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);

    Thread Starter vargh3se

    (@vargh3se)

    Unfortunately, it didn’t work .. all the pages went blank

Viewing 2 replies - 1 through 2 (of 2 total)