Reply To: Programatically choosing Login Welcome and Membership Options pages.

Forums General Programatically choosing Login Welcome and Membership Options pages. Reply To: Programatically choosing Login Welcome and Membership Options pages.

#511
Scott P
Participant

Hello Cristián,

That one is easy. I can just query ICL_LANGUAGE_CODE for the single letter language code. So, for example, if I want to test if the user is in the French site I would just test if (ICL_LANGUAGE_CODE == ‘fr’). My challenge is in understanding how s2member fires the triggers that redirects the user to the members option page and how I can step in and and replace the default url if the user is in, for example, the French context. Ditto for the login welcome page. So my focus is on the s2member side and not WPML. I can see this being generally useful to anyone who needs to redirect based on any conditional that interests them.

Your code example tests for a specific CCAP and then redirects if found. How would I change that to redirect if a specific condition is met? I guess I am trying to better understand the variable _s2member_vars.

if (!empty($_REQUEST['_s2member_vars']) && strpos($_REQUEST['_s2member_vars'], 'ccap..ccap..element') !== false) {
   header('Location: http://mysite.org/french-member-options-page//?lang=fr');
   exit;
}

Many thanks,
Scott