Hi,
I need to enhance the user management form by adding a couple of details about users. I already created two fields on wp_users table and now i need info about how to fill data during user creation process.
Thanks
Adriano
Hi,
I need to enhance the user management form by adding a couple of details about users. I already created two fields on wp_users table and now i need info about how to fill data during user creation process.
Thanks
Adriano
this function will help you
http://codex.wordpress.org/Function_Reference/wp_update_user
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
I think this can help you:
adding-and-using-custom-user-profile-fields
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?
Korus, hook your action for user_register http://codex.wordpress.org/Plugin_API/Action_Reference/user_register
(if you still dont understand: http://codex.wordpress.org/Plugin_API/Action_Reference )
This topic has been closed to new replies.