Created
March 1, 2017 21:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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