WC_Session_Handler::maybe_update_nonce_user_logged_out
When a user is logged out, ensure they have a unique nonce to manage cart and more using the customer/session ID. This filter runs everything wp_verify_nonce() wp_create_nonce() called.
Метод класса: WC_Session_Handler{}
Хуков нет.
Возвращает
int|Строку.
Использование
$WC_Session_Handler = new WC_Session_Handler(); $WC_Session_Handler->maybe_update_nonce_user_logged_out( $uid, $action );
- $uid(int) (обязательный)
- User ID.
- $action(int|строка) (обязательный)
- The nonce action.
Список изменений
| С версии 5.3.0 | Введена. |
Код WC_Session_Handler::maybe_update_nonce_user_logged_out() WC Session Handler::maybe update nonce user logged out WC 10.5.0
public function maybe_update_nonce_user_logged_out( $uid, $action ) {
if ( is_string( $action ) && StringUtil::starts_with( $action, 'woocommerce' ) ) {
return $this->has_session() && $this->get_customer_id() ? $this->get_customer_id() : $uid;
}
return $uid;
}