• Hello,
    i am trying to add somethign which will redirect user to a custom page after user is done editing/updating profile (wp-admin/profile.php) . Let say i want to redirect user to the homepage. i tried a chunk of code, it did redirected but it isn’t updating the changes user made in wp-admin/profile.php . This is what a tried in functinos.php

    add_action('personal_options_update', 'redirect_me');
    function redirect_me(){
      wp_redirect(home_url('/'));
      exit;
    }

    Help will be awesome !
    thx in advnace

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ayaz Malik

    (@wickedsunny1)

    anyone ?

    You are on the right track, but you are using the wrong action hook. You should use the profile_update hook instead of the personal_options_update hook. Use this function below:

    add_action( 'profile_update', 'custom_profile_redirect', 12 );
    function custom_profile_redirect() {
    	wp_redirect( trailingslashit( home_url() ) );
    	exit;
    }

    You can view the tutorial I wrote about it here:

    http://bit.ly/khxOsX

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect User after Editing/Updating Profile’ is closed to new replies.