wc_set_customer_auth_cookie()
Login a customer (set auth cookie and set global user object).
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
wc_set_customer_auth_cookie( $customer_id );
- $customer_id(int) (обязательный)
- Customer ID.
Код wc_set_customer_auth_cookie() wc set customer auth cookie WC 9.8.2
function wc_set_customer_auth_cookie( $customer_id ) { wp_set_current_user( $customer_id ); wp_set_auth_cookie( $customer_id, true ); // Update session. if ( is_callable( array( WC()->session, 'init_session_cookie' ) ) ) { WC()->session->init_session_cookie(); } }