0

I want to redirect users upon registration, login, or any operation, to a specific page. If the user does something something like click "go back", the displayed notice should disappear.
What function would I use?

add_action('redirectToProfil', array( $this, 'redirectToProfile' )); 

public function redirectToProfile(){
    $url = get_site_url(null, '/profile');
    wp_safe_redirect( $url );
    exit;
}

do_action('redirectToProfil');

I tried using $_GET parameters, but it did not work for me.

  • Is the notice once per session, e.g. you can check if you've shown it with a cookie, or only once ever? e.g. you can flag that the user has seen / accepted in user options – Rup Mar 25 at 14:43
  • which function i must use to display notice? – polyman Mar 25 at 16:32
  • How do you want to display the notice? Just as text on the page? As a separate page? As a modal light box on the page? Something else? – Rup Mar 25 at 16:37
  • only text with <div> – polyman Mar 25 at 17:58
  • And i want transfer some value with redirect action. Can help? – polyman Mar 25 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.