Adding a role using Members and Formidable Forms [closed]
You want to use the method WP_User::set_role() https://developer.wordpress.org/reference/classes/wp_user/set_role/ If you want to add the role as an additional role, replace set_role with add_role add_action( ‘frm_after_create_entry’, ‘inactive_to_member’, 20, 2 ); function inactive_to_member($entry_id, $form_id) { if ( $form_id == 21 ) { // form id of the form to copy $user = wp_get_current_user(); //get logged in user … Read more