Title: [Plugin: Codepress Admin Columns] Show extra user fields from diffrent table
Last modified: August 20, 2016

---

# [Plugin: Codepress Admin Columns] Show extra user fields from diffrent table

 *  Resolved [bkng](https://wordpress.org/support/users/bkng/)
 * (@bkng)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-codepress-admin-columns-show-extra-user-fields-from-diffrent-table/)
 * Hi there,
 * Im using buddypress and there i use the option of creating custom user fields
   that you need to fill in with your registration.
    These fiels are stored in a
   diffrent table (xprofile)
 * Now i want these (2) extra fields to show on the admin side when you go to the
   user option.
 * In wordpress in the admin these extra fields do not sho so i thought i could 
   use your plugin for this.
 * Only the pluging only looks for extra custom fields in the same table.
 * Is there a possibility to have the pluging also to look in a diffrent table then
   the standard users table (users)?
 * This would realy be great for me.
 * Thanx in advance,
 * Bert
 * [http://wordpress.org/extend/plugins/codepress-admin-columns/](http://wordpress.org/extend/plugins/codepress-admin-columns/)

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

 *  Plugin Author [Tobias Schutter](https://wordpress.org/support/users/tschutter/)
 * (@tschutter)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-codepress-admin-columns-show-extra-user-fields-from-diffrent-table/#post-2957131)
 * Hi Bert,
 * Currently my plugin only supports tables that are in WordPress Core. There is
   not an option to select another table, like the one BuddyPress has added.
 * Unfortunately my plugin can not help you with this at this time. I will make 
   a note of it so I will give it another look for perhaps a feature release.
 * What you could do in the meanwhile is place this piece of code in your theme’s
   functions.php.
 * Make sure you change the $field_name value to your field title that you want 
   to display:
 *     ```
       function modify_user_table_row( $val, $column_name, $user_id )
       {
       	// edit this part
       	$field_name 	= 'fill in the title of your custom buddyPress user field';
       	// stop editing
   
       	if ( 'buddypress_field' == $column_name ) {
       		$val = xprofile_get_field_data( $field_name, $user_id );
       	}
   
           return $val;
       }
       add_filter( 'manage_users_custom_column','modify_user_table_row',10,3);
   
       function add_my_custom_buddypress_user_column( $column)
       {
       	$column['buddypress_field'] = 'buddypress_field';
   
       	return $column;
       }
       add_filter( 'manage_users_columns', 'add_my_custom_buddypress_user_column' );
       ```
   
 * Hope this helps you on your way 🙂
 * Tobias
 *  Thread Starter [bkng](https://wordpress.org/support/users/bkng/)
 * (@bkng)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-codepress-admin-columns-show-extra-user-fields-from-diffrent-table/#post-2957139)
 * Great and thanx for the info. Will try it out.
 * Great plugin BTW.
 *  Thread Starter [bkng](https://wordpress.org/support/users/bkng/)
 * (@bkng)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-codepress-admin-columns-show-extra-user-fields-from-diffrent-table/#post-2957154)
 * Hi there and it works like a charm.
 * Now im trying to figure out how to add another second field form the sam table.(
   And then ill stop 🙂
 * But i cannot seem to figure out wich code to change.
 * Sure would appreciate your help.
 * Bert
 *  Plugin Author [Tobias Schutter](https://wordpress.org/support/users/tschutter/)
 * (@tschutter)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-codepress-admin-columns-show-extra-user-fields-from-diffrent-table/#post-2957155)
 * Great. For two columns use the following:
 *     ```
       function modify_user_table_row( $val, $column_name, $user_id )
       {
       	$field_name 	= 'fill in the title of your custom buddyPress user field'; // edit this value
       	$field_name2 	= 'fill in the title of your custom buddyPress user field'; // edit this value
   
       	if ( 'buddypress_field' == $column_name ) {
       		$val = xprofile_get_field_data( $field_name, $user_id );
       	}
   
       	if ( 'buddypress_field2' == $column_name ) {
       		$val = xprofile_get_field_data( $field_name2, $user_id );
       	}
   
           return $val;
       }
       add_filter( 'manage_users_custom_column','modify_user_table_row',10,3);
   
       function add_my_custom_buddypress_user_column( $column)
       {
       	$column['buddypress_field']  = 'Column title goes here'; // you can edit this value
       	$column['buddypress_field2'] = 'Column title goes here'; // you can edit this value
   
       	return $column;
       }
       add_filter( 'manage_users_columns', 'add_my_custom_buddypress_user_column' );
       ```
   

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

The topic ‘[Plugin: Codepress Admin Columns] Show extra user fields from diffrent
table’ is closed to new replies.

 * ![](https://ps.w.org/codepress-admin-columns/assets/icon.svg?rev=1521754)
 * [Admin Columns](https://wordpress.org/plugins/codepress-admin-columns/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/codepress-admin-columns/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/codepress-admin-columns/)
 * [Active Topics](https://wordpress.org/support/plugin/codepress-admin-columns/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/codepress-admin-columns/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/codepress-admin-columns/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Tobias Schutter](https://wordpress.org/support/users/tschutter/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-codepress-admin-columns-show-extra-user-fields-from-diffrent-table/#post-2957155)
 * Status: resolved