Skip to content

Instantly share code, notes, and snippets.

@imath
Last active January 11, 2023 21:35
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 imath/7c0fa8c10a3b557a9deffa73ed3e7bcc to your computer and use it in GitHub Desktop.
Save imath/7c0fa8c10a3b557a9deffa73ed3e7bcc to your computer and use it in GitHub Desktop.
Workaround to remove BuddyPress registration overrides
<?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