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.
SOLUTION
I use $_SESSION[]
.