WC_Session_Handler::delete_session()publicWC 1.0

Delete the session from the cache and database.

Method of the class: WC_Session_Handler{}

No Hooks.

Return

null. Ничего (null).

Usage

$WC_Session_Handler = new WC_Session_Handler();
$WC_Session_Handler->delete_session( $customer_id );
$customer_id(int) (required)
Customer ID.

WC_Session_Handler::delete_session() code WC 8.3.0

public function delete_session( $customer_id ) {
	global $wpdb;

	wp_cache_delete( $this->get_cache_prefix() . $customer_id, WC_SESSION_CACHE_GROUP );

	$wpdb->delete(
		$this->_table,
		array(
			'session_key' => $customer_id,
		)
	);
}