Walkthrough: Add a field to the registration page
You can see the actual code examples here:
I’m using WP 2.0.2 and I wanted to add a field to the registration page to collect people’s phone numbers.
First, I added a user_phone field to the wp_users table in my mysql database.
Second, I altered wp-register.php. I added a Phone field to the page that posted to user_phone. I also added a $user_phone variable to the ‘register ‘ case and where the wp_create_user function is called.
Third, I altered includes/registration-functions.php. I added the $user_phone variable to the wp_insert_user function, the wp_create_user function, and the create_user function and their database queries.
Finally, I wanted to receive the users phone # in the “New User Registration” email. To do that I edited includes/pluggable-functions.php. Now the wp_new_user_registration function stipslashes for $user_phone and ads it to the message.
I hope this helps some other WPers!
- The topic ‘Walkthrough: Add a field to the registration page’ is closed to new replies.