Created
December 22, 2019 22:35
-
-
Save KaineLabs/d6f97f2a9f8235d986fa9292e6839684 to your computer and use it in GitHub Desktop.
Disable BuddyPress Registration
This file contains hidden or 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 | |
| /** | |
| * Disable BuddyPress registration process and fallsback to WordPress' one. | |
| */ | |
| function yzc_disable_bp_registration() { | |
| if ( is_user_logged_in() ) { | |
| return false; | |
| } | |
| remove_action( 'bp_init', 'bp_core_wpsignup_redirect' ); | |
| remove_action( 'bp_screens', 'bp_core_screen_signup' ); | |
| } | |
| add_action( 'bp_loaded', 'yzc_disable_bp_registration' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment