I’m working on a custom plugin for a client and I need to add some custom user fields. I’ve searched through the Codex but couldn’t come across the answer.
I basically need to add some new rows to the users table in the MySQL and then add some extra fields during the registration. I’m sure there are other plugins out there that allow you to add custom user fields but I’d like to incorporate it directly into my plugin.
How can I do it?
I’ve answered a similar Question at WordPress Answers: Checkboxes in registration form.
You need the action hooks
register_form
(to inject your input fields) anduser_register
(to process it). The rest of the code is just sample code to check the results in the pages Profile and User Edit.