latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Pro Login Widget Custom Redirect

Home Forums Community Forum Pro Login Widget Custom Redirect

This topic contains 4 replies, has 3 voices. Last updated by  Vincent Miele 3 years, 11 months ago.

Topic Author Topic
Posted: Thursday Jan 24th, 2013 at 11:20 am #39415

For the most part, the pro login widget works well out of the box, except for my home page.

I set it up to go to the “previous page”. This serves two purposes…if someone is viewing private content, they log in and get back to it. Or, if they click a link from an email, they get to that page after logging in.

However, if someone just logs in from the home page, they go back to the home page (obviously the previous page).
If want THEM to get to the login/welcome page.

Is there a way to accomplish this? In other words, if logging in from home page – welcome page- if logging in from anywhere else, go there.

thanks

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Friday Jan 25th, 2013 at 4:01 pm #39547
Bruce
Username: Bruce
Staff Member

Thank-you for your inquiry.

I’m notifying our development team of this, to get their take on it.

In the meantime, you can stop this from happening by adding this code to your site.

<?php
add_filter('ws_plugin__s2member_pro_login_widget_options', 's2hack_stop_redirect_to_home');

function s2hack_stop_redirect_to_home($vars) {
	if(is_home()) /* If we're on the homepage  */ {
		$vars&#91;'login_redirect'&#93; = NULL; /* Unset the login page */
	}
	
	return $vars;
}

&#91;/hilite&#93;
&#91;note_box&#93;
These are <a href="http://codex.wordpress.org/Must_Use_Plugins">Must-Use Plugins</a>. Install the above by putting the content of the hack into a s2hacks.php

file. Then upload the file via FTP to your /wp-content/mu-plugins directory. If you do not have a mu-plugins directory, create it.
[/note_box]

Posted: Friday Jan 25th, 2013 at 5:56 pm #39556

Thanks Bruce…sounds good….but WHERE do I add this?
Can I add right to the widget under additional code?

thanks

  • This reply was modified 3 years, 11 months ago by  Vincent Miele.
Posted: Friday Jan 25th, 2013 at 7:32 pm #39568
Staff Member

Please see his post where he mentions where to place this code, by creating an s2hacks.php.

Posted: Friday Jan 25th, 2013 at 8:20 pm #39576

thanks again

  • This reply was modified 3 years, 11 months ago by  Vincent Miele.
Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.