Drupal - Redirect User to their Profile Page After Saving
As @Aboodred, if you already have the Rules module installed, adding a simple rule can do the job.
Create a rule with the React on event type
After updating an existing user account
.Add a
Page redirect
action. Set the 'Data selector' field toaccount:url
(either manually or using the dropdown).
If you want to do it with code instead of rules you can take a look at how the user_edit_cancel_submit
function does it in user.pages.inc.
First you define an submit function:
$form['#submit'][] = 'custom_redirect_after_save';
Then you add the function:
function custom_redirect_after_save($form, &$form_state) {
if (isset($_GET['destination'])) {
unset($_GET['destination']);
}
$form_state['redirect'] = array("user", array());
}