Support Forum

Logout Redirect

RG Rodrigo B Galluf
Rodrigo B Galluf
Member

I’ve already filled forum / components / login and registration with the url’s that I want to use but I believe wp is overriding it as every log out sends me to wp default log out page.

Here => http://www.mysite.com/wp-login.php

I want here => http://www.mysite.com

 

Any help?

13 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Well – again – out of the box WordPress allows for a redirect to be tacked on to a logout url. And as far as I am aware it does as it is expected to do. So – is it possible that Theme my Login might be overriding that? Can that also set up a redirect perhaps?

RG Rodrigo B Galluf
Rodrigo B Galluf
Member

There is no more login/out plugins. I removed them all. 

Now it’s only sp and wp default. Seems that sp is being override by wp redirects.

YS Yellow Swordfish
Yellow Swordfish
Member

Yes – i just tried it here in my test site and had the same problem as you.

I wonder if WordPress has made some changes there we were not aware of.

I will open a ticket to get it investigated.

 

RG Rodrigo B Galluf
Rodrigo B Galluf
Member

Let me know when you have any solution. I’ll be trying too. 

RG Rodrigo B Galluf
Rodrigo B Galluf
Member

I still have this redirect problem. I set it to redirect to www.mysite.com after logout but it keeps going to www.mysite.com/login.

There is no “redirect” plugin installed.

MP Mr Papa
Mr Papa
Member

you are still having an issue?  pretty sure its confirmed working…

no membership plugins?

RG Rodrigo B Galluf
Rodrigo B Galluf
Member

Yes still being redirect to wp login page.

Where I can find sp redirect code? 

MP Mr Papa
Mr Papa
Member

a ticket was opened as Andy said, but was found working correctly for users and on our test sites… so would like more info if its still occurring… 

but you can find it in simple-press/sp-startup/site/credentials/sp-credentials.php

RG Rodrigo B Galluf
Rodrigo B Galluf
Member

Ok I’m right there.

I want to redirect to www.mysite.com after logout

I have this.. 

function sp_logout_redirect() {
sp_forum_api_support();
global $spThisUser;

$sflogin = sp_get_option(‘sflogin’);
if (!empty($sflogin[‘sflogouturl’])) {
$sfadminoptions = sp_get_member_item($spThisUser->ID, ‘admin_options’);
if ($spThisUser->moderator && $sfadminoptions[‘bypasslogout’]) {
$_REQUEST[‘redirect_to’] = esc_url(wp_login_url());
} else {
$_REQUEST[‘redirect_to’] = $sflogin[‘sflogouturl’];
}
}
$_REQUEST[‘redirect_to’] = apply_filters(‘sph_logout_redirect’, $_REQUEST[‘redirect_to’]);

RG Rodrigo B Galluf
Rodrigo B Galluf
Member

Ok I loged in as a user and the redirect is working properly.

I believe the problem is with moderators only  

if ($spThisUser->moderator && $sfadminoptions[‘bypasslogout’]) {

I believe being a moderator it bypass something

MP Mr Papa
Mr Papa
Member

well, yes… if you said to bypass the logout in the options, that would be the case… sorry, forgot about that option and should have suggested checking it…