[英]How to automatically logout after register in wordpress?
現在,在用戶注冊后,在我的wordpress網站上將重定向到我的帳戶頁面(我使用woocommerce)。
我希望hee在注冊后自動注銷。
因為我要先批准。
這是代碼:
if (is_user_logged_in()) {
$nua = pw_new_user_approve();
$status = $nua->get_user_status(get_current_user_id());
if ($status === 'pending') {?>
HERE IS THE FUNCTION TO LOGOUT AUTOMATICALLY!
<?php
}
}
有什么幫助嗎?
<?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);
}
}
?>
嘗試這個
if (is_user_logged_in()) {
$nua = pw_new_user_approve();
$status = $nua->get_user_status(get_current_user_id());
if ($status === 'pending') {
wp_logout();
}
}
請嘗試一下
<?php echo wp_logout_url( $_SERVER['REQUEST_URI'] ); ?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.