Codex tools: Log in
Contents |
This action hook is generally used to save custom fields that have been added to the WordPress profile page.
This hook only triggers when a user is viewing another user's profile page (not their own). If you want to apply your hook to ALL profile pages (including the current user) then you also need to use the personal_options_update hook.
This example shows how to save a custom field named 'your_field'...
add_action('edit_user_profile_update', 'update_extra_profile_fields');
function update_extra_profile_fields($user_id) {
if ( current_user_can('edit_user',$user_id) )
update_user_meta($user_id, 'my_custom_field', $_POST['your_field']);
}
The edit_user_profile_update hook is located in /wp-admin/user-edit.php
Return to Plugin API/Action Reference