Hi there,
I'm using WP 3.0 and Buddypress. For a few months I'm having trouble redirecting users after logout. Wordpres ALWAYS goes to wp-login.php, no matter what. I've tried various things with the redirect parameter on wp_logout() and wp_logout_url() but nothing helps.
Anybody having the same problems, or does somebody know a way to fix this?
Never mind, I found the solution!
It was because of the Domain mapping plugin; that one messes with the logout/redirects.
I've adjusted that plugin and now it works.
Case closed.
Michael Dance
Member
Posted 11 months ago #
Care to share how you fixed it?
finzend
Member
Posted 11 months ago #
Offcourse! Sorry I didn't do that in the first place;)
Go to domain_mapping.php
Go to the function redirect_login_to_orig and replace it (or add the line with the redirect-if on logout)
function redirect_login_to_orig() {
if ( !get_site_option( 'dm_remote_login' ) || $_GET[ 'action' ] == 'logout' || isset( $_GET[ 'loggedout' ] ) ) {
return false;
}
$url = get_original_url( 'siteurl' );
if ( $url != site_url() ) {
$url .= "/wp-login.php";
// finzend: make sure the redirect keeps working on logout?
if ( ($_GET[ 'action' ] == 'logout') && (!empty($_GET["redirect_to"])) )
$url = $_GET["redirect_to"];
echo "<script type='text/javascript'>\nwindow.location = '$url'</script>";
}
}
Michael Dance
Member
Posted 11 months ago #
madivad
Member
Posted 8 months ago #
Great find, this has been bugging me for a while! Thanks!