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.

Redirection after login using BP login form

Home Forums Community Forum Redirection after login using BP login form

This topic contains 5 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 5 months ago.

Topic Author Topic
Posted: Wednesday Jul 18th, 2012 at 6:49 am #19610

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Wednesday Jul 18th, 2012 at 10:14 pm #19701
Raam Dev
Username: Raam
Staff Member

Hi Masanori,

What is the problem you’re having? Does that code not work? What happens?

Posted: Thursday Jul 19th, 2012 at 3:22 am #19734

Hi Raam,

I need to redirect to the current page after login from the BuddyPress login Widget.

So I tried to use the Hook.
==> http://www.s2member.com/codex/stable/s2member/login_redirects/package-filters/?tw_p=twt

The source code that describes the above to be redirected to current page
from BuddyPress login Widget.

However, It doesn’t work.
It is redirected to the login page of s2member.

Is there any mistake in “ws_plugin__s2member_login_redirection_url” usage?

Posted: Thursday Jul 19th, 2012 at 7:12 am #19751

When you say “It is redirected to the login page of s2member”, do you mean the Login Welcome page?

If in WordPress you use the redirect_to variable in the login page, then it’ll override s2Member’s login redirection. I don’t know if BuddyPress removes [hilite mono]redirect_to[/hilite] or leaves it working as it does by default, so you could try that.

Just add ?redirect_to=http://example.com/abc or (or /abc if its the same site) at the end of the URL of the login page. E.g. http://example.com/wp-login.php?redirect_to=/abc

In the case of a widget, maybe it has a setting for this, or you could edit its template to add [hilite code][/hilite] (if I’m not mistaken) to the HTML form.

I hope that helps.

Posted: Thursday Jul 26th, 2012 at 3:52 am #20295

Hi, Cristian

Redirection problem was solved in the following code.

<?php $redirect_to = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];	?>

<input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" />

Thank you.

Posted: Thursday Jul 26th, 2012 at 7:03 am #20305

Nice! Thanks for the update. I’m glad you were able to solve it. :)

Viewing 5 replies - 1 through 5 (of 5 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.