Problem updating custom field in TML Profile
-
Hi.
I’ve followed the short tutorial [1] on adding new custom fields successfully. For my purpose I’ve added First Name, Last Name (in the same manner as described in the tutorial) and Address. The last field is added as a <textarea> instead of <input> in the custom register-form.php and profile-form.php.
I don’t have problem seeing the inserted values in First Name, Last Name and Address in the Profile page. However, upon editing the value in Address and submitting the form won’t update its value in the database; all other fields are updated as expected.
What I’ve tried:
1) Added the attribute form=”your-profile” to my <textarea>, hoping the submit button would pick up the fresh content in it.
2) Changed <textarea> back to <input> (like First Name and Last Name) in profile-form.php.
3) Added hook ‘edit_user_profile_update’ in theme-my-login-custom.php with the following code:function tml_user_profile_update( $user_id ) {
wp_die ( “Fired!” );if ( current_user_can(‘edit_user’, $user_id) )
update_user_meta($user_id, ‘tml_address’, $_POST[‘tml_address’]);
}add_action(‘edit_user_profile_update’, ‘tml_user_profile_update’);
The hook is never fired, even if I move it into the theme’s functions.php instead.
Can anyone shed some light on this?
[1] Adding Extra Registration Fields – Theme My Login Documentation
https://docs.thememylogin.com/adding-extra-registration-fields/
- The topic ‘Problem updating custom field in TML Profile’ is closed to new replies.