Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Locking a website using bp-custom

Viewing 3 replies - 1 through 3 (of 3 total)
  • Profile photo of Hugo
    Hugo
    Moderator

    @hnla

    well doubt it would be ‘get_page()’ try ‘is_page()’ with a name, slug, or id.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Or use the unfiltered_uri, for example…

    function restrict_access(){
     global $bp_unfiltered_uri;
    
     if ( !is_user_logged_in() && !bp_is_register_page() && !bp_is_activation_page() && ( $bp_unfiltered_uri[0] != 'some-slug') )
      bp_core_redirect( get_option('home') . '/register' );
    
    }
    add_action( 'wp', 'restrict_access', 3 );
    Profile photo of icepin
    icepin
    Participant

    @icepin

    both options working like a charm!
    you guys are awesome, herzlichen dank!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Locking a website using bp-custom’ is closed to new replies.
Skip to toolbar