You need to add plug-in ban on auto-login in woocommerce
-
You need to add plug-in ban on auto-login in woocommerce
function user_autologout(){ if ( is_user_logged_in() ) { wp_logout(); return get_permalink(woocommerce_get_page_id('myaccount')) . "?approved=false"; } } add_action('woocommerce_registration_redirect', 'user_autologout', 2); function registration_message(){ $not_approved_message = '<p class="registration">Send in your registration application today!<br /> NOTE: Your account will be held for moderation and you will be unable to login until it is approved.</p>'; if( isset($_REQUEST['approved']) ){ $approved = $_REQUEST['approved']; if ($approved == 'false') echo '<p class="registration successful">Registration successful! You will be notified upon approval of your account.</p>'; else echo $not_approved_message; } else echo $not_approved_message; } add_action('woocommerce_before_customer_login_form', 'registration_message', 2);
useful thing ??
- The topic ‘You need to add plug-in ban on auto-login in woocommerce’ is closed to new replies.