WordPress.org

Ready to get started?Download WordPress

Forums

Adding new users details (7 posts)

  1. Adriano Di Toppa
    Member
    Posted 3 years ago #

    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

  2. kkarpieszuk
    Member
    Posted 3 years ago #

  3. Adriano Di Toppa
    Member
    Posted 3 years ago #

    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

  4. kkarpieszuk
    Member
    Posted 3 years ago #

    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

  5. carlla
    Member
    Posted 3 years ago #

    I think this can help you:
    adding-and-using-custom-user-profile-fields

  6. Korus IT
    Member
    Posted 3 years ago #

    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?

  7. kkarpieszuk
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags