WC_Session_Handler::session_exists
Check if a session exists in the database.
Метод класса: WC_Session_Handler{}
Хуков нет.
Возвращает
bool.
Использование
// private - только в коде основоного (родительского) класса $result = $this->session_exists( $customer_id );
- $customer_id(строка) (обязательный)
- Customer ID.
Код WC_Session_Handler::session_exists() WC Session Handler::session exists WC 11.2.2
private function session_exists( $customer_id ) {
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- trusted table name.
return $customer_id && null !== $GLOBALS['wpdb']->get_var( $GLOBALS['wpdb']->prepare( "SELECT session_key FROM {$this->_table} WHERE session_key = %s", $customer_id ) );
}