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
Post a Comment