Title: [Plugin: Theme My Login] adding new fields?
Last modified: August 20, 2016

---

# [Plugin: Theme My Login] adding new fields?

 *  Resolved [cybershot](https://wordpress.org/support/users/cybershot/)
 * (@cybershot)
 * [14 years ago](https://wordpress.org/support/topic/plugin-theme-my-login-adding-new-fields/)
 * For the last hour, I have been following the instruction here
 * [http://www.jfarthing.com/development/theme-my-login/adding-extra-registration-fields/](http://www.jfarthing.com/development/theme-my-login/adding-extra-registration-fields/)
 * I have found that there is no theme-my-login-custom.php file that I can find 
   anywhere in the plugin folder. So I made my own and put it in the plugin folder
   as the instructions say to do. Not in plugins/theme-my-login but just /plugins
 * I am not sure if it is working. I see the new field in my registration form but
   once I get logged in, I do not see the field in the profile nor do I see the 
   information in the profile. Do I now need to use the theme-my-profile to show
   this new data?
 * [http://wordpress.org/extend/plugins/theme-my-login/](http://wordpress.org/extend/plugins/theme-my-login/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [14 years ago](https://wordpress.org/support/topic/plugin-theme-my-login-adding-new-fields/#post-2792078)
 * As I mentioned in the other post, there is a different hook that needs to be 
   used to get the data in the profile. That hook is **edit_user_profile**.
 * Add something like this to _theme-my-login-custom.php_:
 *     ```
       function tml_edit_user_profile( $profileuser ) {
       	?>
       	<p>
       		<label for="phone_number">Phone Number</label>
       		<input id="phone_number" type="text" name="phone_number" value="<?php echo $profileuser->phone_number; ?>" />
       	</p>
       	<?php
       }
       add_action( 'edit_user_profile', 'tml_edit_user_profile' );
       ```
   
 * Of course, you would edit it to suit your needs, but that’s the general idea.
   This approach will add the fields to TML’s Themed Profiles, as well as to WP’s
   default profiles.
 *  [p4004](https://wordpress.org/support/users/p4004/)
 * (@p4004)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-adding-new-fields/#post-2792269)
 * Why this hook is not documented at [http://www.jfarthing.com/development/theme-my-login/](http://www.jfarthing.com/development/theme-my-login/)?
   I was looking for it for an hour until I found it here.
 * Your plugin is great, but lack of documentation makes customizing it a bit difficult.
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-adding-new-fields/#post-2792271)
 * Because that hook is a [WordPress hook](http://codex.wordpress.org/Plugin_API/Action_Reference/edit_user_profile).
 *  [Imran ul Haque Ansari](https://wordpress.org/support/users/imranansari/)
 * (@imranansari)
 * [13 years ago](https://wordpress.org/support/topic/plugin-theme-my-login-adding-new-fields/#post-2792313)
 * I have added the phone number field in my registration form.
    i just copy theme-
   my-login\templates\register-form.php file in my theme folder and added this code
   below the email field
 *     ```
       <p>
       <label for="user_phone<?php $template->the_instance(); ?>"><?php _e('Phone'); ?></label>
       <input type="text" name="user_phone" id="user_phone<?php $template->the_instance(); ?>" class="input" value="<?php $template->the_posted_value('user_phone'); ?>" size="20" />
       </p>
       ```
   
 * and add this code in my function.php
 *     ```
       function tml_edit_user_profile( $profileuser ) { ?>
       <p>
       <label for="user_phone">Phone Number</label>
       <input id="user_phone" type="text" name="user_phone" value="<?php echo $profileuser->user_phone; ?>" />
       </p>
       <?php
       }
       add_action( 'edit_user_profile', 'tml_edit_user_profile' );
   
       function tml_user_register( $user_id ) {
       	if ( !empty( $_POST['user_phone'] ) )
       		update_user_meta( $user_id, 'user_phone', $_POST['user_phone'] );
       }
       add_action( 'user_register', 'tml_user_register' );
       ```
   
 * This code is working on my site.
 * and thanks Jeff for such a good plugin,it is easy to customize.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Theme My Login] adding new fields?’ is closed to new replies.

 * ![](https://ps.w.org/theme-my-login/assets/icon-256x256.png?rev=1891232)
 * [Theme My Login](https://wordpress.org/plugins/theme-my-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/theme-my-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/theme-my-login/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-my-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-my-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-my-login/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [Imran ul Haque Ansari](https://wordpress.org/support/users/imranansari/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/plugin-theme-my-login-adding-new-fields/#post-2792313)
 * Status: resolved