Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Redirect to root after Login


Ted Mann
Participant

@tedmann

If anyone is looking to hack the adminbar so that when users log in, they stay on the current blog they’re on, just edit the bp-core-adminbar.php file and change the reference to $bp->root_domain, under the “log in and sign up links” section, to $current_blog. Also, I took out the redirect as well. So, my login widget now looks like this:

// **** "Log In" and "Sign Up" links (Visible when not logged in) ********
function bp_adminbar_login_menu() {
global $bp;

if ( !is_user_logged_in() ) {
echo '<li class="bp-login no-arrow"><a href="' . $current_blog . '/wp-login.php">' . __( 'Log In', 'buddypress' ) . '</a></li>';

// Show "Sign Up" link if registrations are allowed
if ( get_site_option( 'registration' ) != 'none' ) {
echo '<li class="bp-signup no-arrow"><a href="' . bp_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
}
}
}

Skip to toolbar