An update… The S2Member registration process passes $user_id to the user_register function. Within the user_register function which Ive tweaked via code in S2-Hacks.php, I’ve tried querying the database based on user_id. But the results are either empty fields or values that don’t match the final results. Here is the code within S2-hacks.php:
function dw_reg_confirm($user_id) {
//This is the url of the page you want to show after registration.
//Get user role based on the user ID of the person who just completed and submitted a registration form
$user = new WP_User($user_id)
$role = $user->roles[0];
//Build the confirmation page URL and add role value as passed parameter
$confirm_page = “http://fakesite.com/membership-application-submitted?" . $role;
wp_redirect($confirm_page);
}
add_action(‘user_register’, ‘dw_reg_confirm’);
In this case the roles[0] value returned is ‘Subscriber’ instead of the final value which should be s2member_level2. When I use the same code on a normal WP page (manually entering the user id that was just registered), I get the expected value of ‘s2member_level2’ so it appears that sometime after invoking the user_register function and passing control to the redirect URL, S2 updates the roles[0] value from ‘ Subscriber’ to the appropriate value.
So…. the question remains… Within the user_register function, armed with the user id value, is there any way to find out what level of registration profile the user just completed?
One piece of additional informaton, I’m using the PayPal Pro forms for each level but I’m not using PayPal for any of the levels (payment is solicited on the registration confirmation page). As an example, here is the code for a level 2 registration:
[s2Member-Pro-PayPal-Form register="1" level="2" ccaps="" desc="$40 for one year membership" custom="dimpled-orb.com" tp="0" tt="D" captcha="clean" /]