Advertisement:

Author Topic: After a user REGISTER transfer/redirect them to a "link" that we want how?  (Read 255 times)

developGr

  • Full Member
  • ***
  • Posts: 161
After a user REGISTER transfer/redirect them to a "link" that we want how?

calinbehtuk

  • Sr. Member
  • ****
  • Posts: 450
Re: After a user REGISTER transfer/redirect them to a "link" that we want how?
« Reply #1 on: September 27, 2017, 12:56:04 pm »
I do not know if this what you intended but you have a hook that you can use, and this hook run after the registration form is submit and the registration process is complete.
Please take note that if in your user settings if the option that force user to validate the account is checked the script display a message that warn users that they need to validate the account, so if you redirect on other page, make sure that you include that message if this option is checked.

add this in functions.php from your theme

Code: [Select]
function redirect_after_register($user_id) {
    $url = osc_search_url();//the redirect link ,now it on search page
    header("Location: $url");
    exit();
}

osc_add_hook('user_register_completed', 'redirect_after_register');