Hey Christian, here I am showing up in another thread
I tried this code and it's not working for my special redirection URL for subscribers (level 0).
- Code: Select all
add_action('ws_plugin__s2member_during_configure_user_registration', 's2_auto_login_after_registration');
function s2_auto_login_after_registration($vars = array()) {
if (!is_admin() && $vars['processed'] === 'yes') {
wp_new_user_notification($vars['user_id'], $vars['pass']);
wp_set_auth_cookie($vars['user_id'], false, is_ssl());
wp_redirect(S2MEMBER_LOGIN_WELCOME_PAGE_URL . '?first');
exit();
}
}
It works, but it redirects to the URL for S2_Member_Level1. For example purposes, here's what my URL looks like on the Login Welcome Page box:
http://domain.com/download-%%current_user_level%%
Of course, upon login or clicking the Profile link it redirects to the proper page just not after user registration. I looked in s2member/includes/classes/constants.php.inc for another constant that handles the Special Redirection URL but the constant definition for S2MEMBER_LOGIN_WELCOME_PAGE_URL seems to handle that situation.
Not sure how to get this working. Thanks!