Title: Capturing Extra Field
Last modified: August 22, 2016

---

# Capturing Extra Field

 *  Resolved [Doogie1001](https://wordpress.org/support/users/doogie1001/)
 * (@doogie1001)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/capturing-extra-field/)
 * I need to capture an additional field at login time.
 * I’m using Buddypress and have assigned user to buddypress groups.
    I need to 
   capture which group a member belongs to as they login.
 * I have successfully added additional code to the plugin to record and additional
   field into the database which works fine.
 * by this I mean i have added a field in the DB and included and extra field (called
   groups) in the update routine in the plugin. No Problems there.
 * Im having issue however actual getting the Buddy Press group.
 * Ive tried various syntax’s and variables from Budyppress and contact the buddy
   press forums and support to try and find a way to get this variable.
 * I need to capture this data so that i can do reporting based on the CSV produced
   by LoginLog – but i need a break down by group.
 * Any help would be greatly appreciated.
 * Here is the code where im trying to store the extra bit of data…
 *     ```
       $group =  ???????;
   
       	$values = array(
                   'uid'           => $uid,
                   'user_login'    => $user_login,
                   'user_role'     => $user_role,
       			'user_email'		=> $user_email,
                   'time'          => current_time('mysql'),
                   'ip'            => isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? esc_attr($_SERVER['HTTP_X_FORWARDED_FOR']) : esc_attr($_SERVER['REMOTE_ADDR']),
       			'country'      => $guest_country,
       			'city'			=> $guest_city,
                   'login_result'  => $this->login_success,
                   'data'          => $serialized_data,
       			'name'			=> $USErname,
       			'group'			=> $group
                   );
   
               $format = array('%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s','%s','%s');
   
               $this->save_data($values, $format);
       ```
   
 * [https://wordpress.org/plugins/user-login-log/](https://wordpress.org/plugins/user-login-log/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/capturing-extra-field/#post-5907928)
 * Hi,
 * Can you tell me that which role are you assigned that group?
 * They are subscriber or other?
 *  Thread Starter [Doogie1001](https://wordpress.org/support/users/doogie1001/)
 * (@doogie1001)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/capturing-extra-field/#post-5907941)
 * The users will be various roles. Subscriber, author editor admin etc
 * But it’s not the role I need to capture. It’s the buddy press group to which 
   the user belongs
 * I’ve created buddy press groups for sales, office staff, business development,
   warehouse
 *  Plugin Author [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/capturing-extra-field/#post-5907995)
 * please contact me at **lizarweb[at]gmail[dot]com**

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Capturing Extra Field’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/user-login-log_97949d.svg)
 * [User Login Log](https://wordpress.org/plugins/user-login-log/)
 * [Support Threads](https://wordpress.org/support/plugin/user-login-log/)
 * [Active Topics](https://wordpress.org/support/plugin/user-login-log/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-login-log/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-login-log/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/capturing-extra-field/#post-5907995)
 * Status: resolved