Skip to content

Instantly share code, notes, and snippets.

@kevinvess
Created March 1, 2017 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinvess/8a11843cc6f70213f50eeb7153c5f6ff to your computer and use it in GitHub Desktop.
Save kevinvess/8a11843cc6f70213f50eeb7153c5f6ff to your computer and use it in GitHub Desktop.
Sample code showing how to bypass the Force Login plugin for BuddyPress registration
<?php
/**
* Bypass Force Login to allow for exceptions.
*
* @return bool Whether to disable Force Login. Default false.
*/
function my_forcelogin_bypass( $bypass ) {
// add exception for buddypress login URLs
if ( function_exists('bp_is_register_page') ) {
if ( bp_is_register_page() || bp_is_activation_page() ) {
$bypass = true;
}
}
return $bypass;
}
add_filter('v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment