Redirect unapproved user
-
Hello. how are you?
sorry to take your time again.I would like that when registering and when trying to log in (without being approved) the user is redirected to a page of instructions.
I tried using the code you suggested in this post to redirect after registration, and the redirects works
add_action( 'user_register', 'myplugin_registration_save', 10, 1 );
function myplugin_registration_save( $user_id ) {
wp_redirect( home_url('/profesional/'));
exit;
}however it generates another problem, woocommerce stops sending the default welcome email to the user.
From what I’ve researched, it may be because of using “exit” and “die” in the function.
Heateor Social Login, provided me a code that works correctly with login social only, (after register ou when log in without being approved it redirects to the instructions page), without affecting the sending of emails from woocommerce:
function heateor_sl_login_page_redirect() {
if ( isset( $_GET['heateor_ua'] ) ) {
wp_redirect( '/cadastro-em-analise/' );
die;
}
}
add_action( 'init', 'heateor_sl_login_page_redirect' );How can I do this with the default woocommerce register/login, without affecting the sending of the user’s welcome email?
I try this code bellow, but doesn’t redirect when NUA is active.
add_filter( 'woocommerce_registration_redirect', function() {
return home_url('/politica-de-cookies/');
} );I think doing a pending or denied status check works, but I can’t make any progress on it.
Can you help-me?
The topic ‘Redirect unapproved user’ is closed to new replies.