WC_Session_Handler::cleanup_sessions()publicWC 1.0

Cleanup session data from the database and clear caches.

Метод класса: WC_Session_Handler{}

Хуков нет.

Возвращает

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

Использование

$WC_Session_Handler = new WC_Session_Handler();
$WC_Session_Handler->cleanup_sessions();

Код WC_Session_Handler::cleanup_sessions() WC 8.7.0

public function cleanup_sessions() {
	global $wpdb;

	$wpdb->query( $wpdb->prepare( "DELETE FROM $this->_table WHERE session_expiry < %d", time() ) ); // @codingStandardsIgnoreLine.

	if ( class_exists( 'WC_Cache_Helper' ) ) {
		WC_Cache_Helper::invalidate_cache_group( WC_SESSION_CACHE_GROUP );
	}
}