Skip to content

Instantly share code, notes, and snippets.

@Willem-Siebe
Last active October 23, 2015 15:13
Show Gist options
  • Save Willem-Siebe/a14c4ec86eddd7073f67 to your computer and use it in GitHub Desktop.
Save Willem-Siebe/a14c4ec86eddd7073f67 to your computer and use it in GitHub Desktop.
Assign user to other role then in used in settings of Formdable Registration plugin, see https://formidablepro.com/help-desk/formidable-registration-give-user-other-role-by-choosing-for-checkbox/
// Assign user to other role then in used in settings of Formdable Registration plugin, see https://gist.github.com/Willem-Siebe/a14c4ec86eddd7073f67.
function frmreg_new_role($user_role, $atts){
extract($atts);
if($form->id == 7){ // WSIS: change this to your form ID
if($_POST['item_meta'][103] == 'professional') //change 125 to the ID of your field and 'Author' to the value of your radio button WSIS: or single checkbox
$user_role = 'ignite_level_5367f4bc4171a'; // WSIS: rolename
}
return $user_role;
}
add_filter('frmreg_new_role', 'frmreg_new_role', 10, 2);
@Willem-Siebe
Copy link
Author

Changed $role to $user_role, since I updated the plugin from version 1.11.03 to 1.11.05 and the main plugin from version 1.07.11 to 2.0.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment