You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of our users have a User Registration form done with the User Registration add-on.
The function below assign a custom role to this user by combining 2 fields:
add_action("gform_user_registered", "change_roles", 10, 4);
function change_roles($user_id, $config, $entry, $user_pass) {
//NOTE: change 5 below with the ID of your field that has the roles in it and replace 6 with the ID of the field with your locations in it. Make sure the value of those fields have the proper values so that when put together will generate the proper role (i.e. student-nyc)
$selected_role = $entry[5] . '-' . $entry[6];
$user = new WP_User( $user_id );
$user->set_role( $selected_role );
}
The problem is that if he uses GravityView to edit details about this user profile, the custom role was lost.
On my tests, I've found this:
Test 1
Registered new user with custom role = student-tokio
Updated the user details with GravityView
The role gets back to the default selected option in the User Registration add-on
Test 2
Registered new user with custom role = student-tokio
Disabled the User Registration add-on
Updated the user details with GravityView
The role student-tokio was kept for the user
It looks like a problem with that GF Add-on and not GravityView...
One of our users have a User Registration form done with the User Registration add-on.
The function below assign a custom role to this user by combining 2 fields:
The problem is that if he uses GravityView to edit details about this user profile, the custom role was lost.
On my tests, I've found this:
Test 1
Test 2
It looks like a problem with that GF Add-on and not GravityView...
Here's the HS ticket with more details: https://secure.helpscout.net/conversation/111017013/3056/
┆Issue is synchronized with this Asana task
The text was updated successfully, but these errors were encountered: