Home › Forums › Community Forum › Logout Redirect?
Tagged: logout, redirect on logout
This topic contains 11 replies, has 5 voices. Last updated by GaperVille 4 years, 9 months ago.
Topic Author | Topic |
---|---|
Posted: Sunday Mar 11th, 2012 at 1:44 pm #7860 | |
|
|
I know there are settings to offer a Welcome page and a Sign-up page when someone tries to access content they are not allowed to access but is there a way to redirect the user to another page, one of my choosing, when a Member logs out, such as a Goodbye page? thanks |
List Of Topic Replies
Author | Replies |
---|---|
Author | Replies |
Posted: Tuesday Mar 13th, 2012 at 8:38 pm #8068 | |
|
|
To my knowledge, this is not a built in function of s2member. However, wordpress itself has a function that is supposed to do this: http://codex.wordpress.org/Function_Reference/wp_logout_url Basically, if your wp_logout_url() has a valid link, the user should be re-direced to that page when they logout.
Hope that helps, Dave |
|
Posted: Tuesday Mar 27th, 2012 at 3:43 pm #9277 | |
|
|
Whew good to see this logout redirect. I’m very to wordpress & s2members. I have seen this suggested function but don’t know how to use it. I do have a test page i’m developing that I want the logout redirector. We want the user who logout to go to the home page instead of the login page. Could you please tell me where to append the above function. Below is what I have on my page: NOT LOGGED IN Some public content. They’re NOT logged in. A leading !exclamation means false. http://localhost:40628/wp-login.php; window.location = ‘http://localhost:40628/wp-login.php?redirect_to=http://localhost:40628/?page_id=436’; Any is greatly appreciated. H E L P! |
|
Posted: Thursday Apr 12th, 2012 at 12:48 pm #10673 | |
|
|
Hi I have a line in functions.php that adds logout the the membership menu. No matter what I do, the system redirects to the membership options page on logout. This URL query string seems to append to the home page link despite anything I do.
Any suggestions? |
|
Posted: Thursday Apr 12th, 2012 at 1:05 pm #10675 | |
|
|
What is the function in your menu look like? Dave |
|
Posted: Thursday Apr 12th, 2012 at 1:30 pm #10676 | |
|
|
Here it is — thanks for asking. Around line 67, the code sets the logout_link to $wpurl (which is ‘index.php’). This gets overwritten to become the membership options page (and a buch of MOP variables) no matter what I do:
|
|
Posted: Thursday Apr 12th, 2012 at 1:44 pm #10678 | |
|
|
Try replacing this:
with this:
See if that works. Dave |
|
Posted: Thursday Apr 12th, 2012 at 1:58 pm #10679 | |
|
|
Dave, I have tride using home_url() in place of index.php. No matter what I put there, a query string gets added. It looks like a set of MOP variables. Can I tell S2Member not to add them on logout? Here is the link generated by home_url():
And here is how the system resolves the link. There’s a query string in the URL that shows up as a result:
|
|
Posted: Thursday Apr 12th, 2012 at 2:16 pm #10680 | |
|
|
hm… that first url is what shows if you hover over the logout link on your menu too? Dave |
|
Posted: Thursday Apr 12th, 2012 at 2:34 pm #10681 | |
|
|
Yes — There are several places to logout (menu, forum). All logouts get redirected to the membership options page, instead of home. |
|
Posted: Thursday Apr 12th, 2012 at 3:52 pm #10689 | |
|
|
hm. I have to admit it’s got me stumped. Maybe someone else can chime in! Dave |
|
Posted: Thursday Apr 12th, 2012 at 5:53 pm #10699 | |
|
|
This plugin seems to be what your looking for or @ least you can view to function code and make it better. It has a high rating and may be a worthy time saver. http://wordpress.org/extend/plugins/peters-login-redirect/ Whatever its worth, I use a Forum Plugin that comes with this feature because by default your logout redirect goes to the forum login and had to find the settings to omit the redirect all together. This forum plugin also comes w/ a Login redirect & Registration redirect: It will also has a 4th option for a, Login URL in new user email: I don’t know how these work w/ s2 other than I know it effects the logout for sure. Hope this helps! ;-) |
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.