This topic has 1 reply, 1 voice, and was last updated 7 years by jackbean.

  • Author
  • #178034
     jackbean
    Participant

    Hi,

    I just want to mention I mentioned this issue also in another ticket here:   https://archived.seventhqueen.com/forums/topic/theme-update-and-the-child-theme#post-178033

    I always appreciate the support and help and don’t want to waste SeventhQueen’s resources! 🙂 I thought I will opened a different ticket because the other ticket was about theme updating, and here I want to pointing out this is potentially a bug 🙂

     

    Specifically, I added the following codes to my Kleo Child functions.php file. The codes are meant to re-direct all non-logged in users to the Register page if the non-logged in User tries to use any of the BuddyPress or bbPress pages.

    ======================================================================================================
    /**
    * Redirect buddypress and bbpress pages to registration page for non-logged in Users
    */
    function kleo_page_template_redirect()
    {
    //if not logged in and on a bp page except registration or activation
    if( ! is_user_logged_in() &&
    ( ( ! bp_is_blog_page() && ! bp_is_activation_page() && ! bp_is_register_page() ) || is_bbpress() )
    )
    {
    wp_redirect( home_url( ‘/register/’ ) );
    exit();
    }
    }
    add_action( ‘template_redirect’, ‘kleo_page_template_redirect’ );
    ======================================================================================================

    I got this code from the Kleo support link here:https://seventhqueen.com/blog/code-snippets/restrict-guest-users-from-accessing-buddypress-or-bbpress-pages.html#comment-45

    The code was working, but stopped working after the Kleo update.

    Very strangely, now all BuddyPress pages (Members, Groups) for non-logged in user will go to the Member Levels page (instead of the Register page). I don’t know why that’s happening. Also, the bbpress page (“Forum”) is open unprotected, and non-logged in user can see the content.

    You can see how the website is now behaving if you goto:      https://www.prohrweb.org/members/

    And the page will be automatically redirected to:       https://www.prohrweb.org/membership-account/membership-levels/

    This is very odd. Please let me what you think. Thanks very much as always!

    JB

    #178164
     jackbean
    Participant

    closing this tkt as Kieran is looking at this issue for me on a diff tkt.

    Thanks Kieran!!!

    JB

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

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?