php - How to automatically logout after register in wordpress? -


now in wordpress website after user registering redirected account page (i use woocommerce).

i want hime logged out automatically after register.

because want approve first.

this code:

if (is_user_logged_in()) {     $nua = pw_new_user_approve();     $status = $nua->get_user_status(get_current_user_id());     if ($status === 'pending') {?>         here function logout automatically!         <?php      } } 

any please?

<?php if (is_user_logged_in()) {     $nua = pw_new_user_approve();     $status = $nua->get_user_status(get_current_user_id());     if ($status === 'pending') {     $redirect = 'sitepath';  wp_logout_url($redirect);             } } ?>  

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -