Last active
January 11, 2023 21:35
-
-
Save imath/7c0fa8c10a3b557a9deffa73ed3e7bcc to your computer and use it in GitHub Desktop.
Workaround to remove BuddyPress registration overrides
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 | |
/** | |
* Put this file into the `wp-content/mu-plugins` directory. | |
*/ | |
function restore_wp_registration_url() { | |
return site_url( 'wp-login.php?action=register', 'login' ); | |
} | |
function use_a_specific_wordpress_page() { | |
$page_id = 1; // replace with your page ID. | |
return get_permalink( $page_id ); | |
} | |
function remove_bp_registration_overrides() { | |
remove_filter( 'register_url', 'bp_get_signup_page' ); | |
remove_action( 'bp_init', 'bp_core_wpsignup_redirect' ); | |
// To restore the regular WP Registration URL, uncomment the following line. | |
//add_filter( 'bp_get_signup_page', 'restore_wp_registration_url' ); | |
// To use a specific WordPress page, uncomment the following line. | |
//add_filter( 'bp_get_signup_page', 'use_a_specific_wordpress_page' ); | |
} | |
add_action( 'init', 'remove_bp_registration_overrides', 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment