Last active
October 23, 2015 15:13
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.