Hi,
this is a very useful lik, by the way I can’t understand well how to add a new column in wp_users table and allow Admin to fill data in this column using standard back-end ‘add-new-user’ form.
Could u please help me in this?
Thanks in advance
Adriano
don’t add new column to wp_users. for additional user data is table wp_usermeta, where is stored:
id – id of row in table
user_id – which user wordpress should be associated with additional data
meta_key – name of additional data
meta_value – value of additional data
so for example you want to add for users ‘favorite color’. now you want to add next column to wp_users called ‘favorite_color’. don’t do this. instead save this data in wp_usermeta with this function:
update_user_meta('12', 'favorite_color', 'pink');
this will associete pink as favorite color of user whos id is 12.
if you want to read favorite color of user 23:
get_user_meta('23', 'favorite_color', true);
more info about thos functions:
http://codex.wordpress.org/Function_Reference/update_user_meta
http://codex.wordpress.org/Function_Reference/get_user_meta
Hi, I have the same problem.
I added some additional fields in the wp_users table and I want to populate when I create a new user.
How can I do?