Guest User

BuddyPress Lockdown

a guest
Nov 28th, 2011
2,695
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. // **** Privacy ********
  4. function restrict_access(){
  5. global $bp, $bp_unfiltered_uri;
  6.  
  7. // If user is not logged in and
  8. if (!is_user_logged_in() &&
  9. (
  10. // The current page is not register or activation
  11. !bp_is_register_page() &&
  12. !bp_is_activation_page()
  13. )
  14.  
  15. ) {
  16. // Redirect to registration page. Change /join to your register page slug
  17. bp_core_redirect( get_option('home') . '/join' );
  18. }
  19. }
  20.  
  21. add_action( 'wp', 'restrict_access', 3 );
  22.  
RAW Paste Data