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.

Login redirect function

Home Forums Community Forum Login redirect function

This topic contains 1 reply, has 2 voices. Last updated by  Raam Dev 4 years, 3 months ago.

Topic Author Topic
Posted: Monday Oct 8th, 2012 at 3:30 pm #27828

Hi,
Got a strange problem. The url field in s2m backend cant use %%, need to keep this dynamic, so I got a function from this forum, with some problem :

1) The $username variable is stripped out in my custom function in browser. Below only returns:

http://domain.com/sv/members// OR http://domain.com/members//

But the string echoed (when testing) in the function works.

function ua_redirect_after_login($url){
$username = get_user_field(“user_login”);
$la = ICL_LANGUAGE_CODE;
if($la == “en”) $la = “”;
else $la = $la.”/”;
$url = $GLOBALS[‘INSTALL’].”/”.$la.”members/”.$username.”/”;
// echo $url – EVERYTHING IS FINE HERE
return $url;
}
add_filter( “ws_plugin__s2member_login_redirection_url” ,”ua_redirect_after_login”, 1 );

Do I maybe need to remove another filter first or ?

2) This function also ALWAYS parses 3 times, everywhere I go on the page. Is that normal?

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Tuesday Oct 9th, 2012 at 5:48 am #27866
Raam Dev
Username: Raam
Staff Member

Closing this thread because it’s a duplicate of this thread: http://www.s2member.com/forums/topic/redirect-problem/

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