0

How would I go about doing this? Thank you!

1 Answer 1

1

Instead of adding new columns to the WordPress database, you might want to use the wp_usermeta table. It is used to store any kind of data about your users (just like the wp_postmeta for your posts and pages).

To add fields on the registration form you can use the user_new_form action which is triggered by the admin form or the register_form on the registration form on the website.

Then, hook into the insert_user_meta filter (triggered after the user save) and add the user meta that you submitted with your form.

Finally, as you probably need to display those values in the user edit form, try to hook into edit_user_profile to add your custom fields in the user profile page. When posting the form, the user update function will automatically trigger the same function you used to add the user meta.

Not the answer you're looking for? Browse other questions tagged or ask your own question.