Saving new custom user profile fields
-
I’ve added the html elements on the user profile. Once the user hits the submit button, i assume the following code would execute right? But then after that, wordpress fails. It shows a blank page and i can see that the url is pointing at the profile.php page. Anything wrong with my code? Please help.
add_action( ‘personal_options_update’, ‘my_save_extra_profile_fields’ );
add_action( ‘edit_user_profile_update’, ‘my_save_extra_profile_fields’ );function my_save_extra_profile_fields( $user_id ) {
if ( !current_user_can( ‘edit_user’, $user_id ) )
return false;/* Copy and paste this line for additional fields. Make sure to change ‘twitter’ to the field ID. */
update_usermeta( $user_id, ‘name’, $_POST[‘name’] );
}Thanks
- The topic ‘Saving new custom user profile fields’ is closed to new replies.