Title: Registered User Roles
Last modified: August 30, 2016

---

# Registered User Roles

 *  [dave8528](https://wordpress.org/support/users/dave8528/)
 * (@dave8528)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/registered-user-roles/)
 * Hi,
    I am using a form plugin which enables me to create forms on a fly which
   then I can map it with registration fields as well. Since I needed to customize
   the form to behave certain way, I hired a developer to do what I need. But it
   seems that the core of that form plugin has been changed to do just that and 
   I can not use the plugin to create other forms since it is redirecting users 
   to a URL that was set for that particular form. I have been able to locate the
   code in the core that is responsible for this which looks like this:
 *     ```
       if( empty($errors) && @count($arf_errors) == 0){
   
                   $_POST['arfentrycookie'] = 1;
   
       			if($params['action'] == 'create'){
   
                       if (apply_filters('arfcontinuetocreate', true, $_POST['form_id']) and !isset($arfcreatedentry[$_POST['form_id']]['entry_id']))
   
       				{
   
       					unset($_SESSION['vpb_captcha_code_'.$_POST['form_id']]);
   
                           $arfcreatedentry[$_POST['form_id']]['entry_id'] = $db_record->create( $_POST );
   
       					$return["conf_method"] = "redirect";
   
       					$return["entry_id"] = $arfcreatedentry[$_POST['form_id']]['entry_id'];
   
       					$return["item_meta"] = $_POST['item_meta'];
   
       					$return["org_name"] = slugify($_POST['item_meta'][83]);
   
       					$return["return_url"] = get_permalink(110);
   
       					 $loginusername = $_POST['item_meta'][132];
       					 $loginpassword = $_POST['item_meta'][133];
   
       					 $creds['user_login'] = $loginusername;
   
                   		 $creds['user_password'] = $loginpassword;
   
                   		 $creds['remember'] = true;
   
                  			 $autologin_user = wp_signon( $creds, false );
   
       					 $user = get_user_by('login', $loginusername);
               			 $user_id = $user->ID;
   
       					 wp_set_current_user($user_id, $loginusername);
               			 wp_set_auth_cookie($user_id);
       					mysql_query("insert into wp_usermeta(user_id,meta_key,meta_value) values('$user_id','org_slug','$loginusername')");
   
       					echo json_encode($return);
   
       					exit;
   
       				}
   
                   }
       ```
   
 * My questions are:
    1- where in this code is being declared what/which role does
   the user have? 2- can I modify this code to declare which form number can it 
   be applied to…? (like form #100)
 * Greatly appreciate any assistance I get get.
 * Regards,
 * Dave

The topic ‘Registered User Roles’ is closed to new replies.

## Tags

 * [forms](https://wordpress.org/support/topic-tag/forms/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [dave8528](https://wordpress.org/support/users/dave8528/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/registered-user-roles/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
