LLMS_Abstract_Session_Database_Handler::clean( boolean $expired_only = true )
Delete all sessions from the database
Description Description
This method is the callback function for the llms_delete_expired_session_data
cron event, which deletes expired sessions hourly.
This method is also used by the admin tool to remove all sessions on demand.
Parameters Parameters
- $expired_only
-
(boolean) (Optional) If
true
, only delete expired sessions, otherwise deletes all events.Default value: true
Return Return
(int)
Source Source
File: includes/abstracts/llms-abstract-session-database-handler.php
public function clean( $expired_only = true ) { global $wpdb; $query = "DELETE FROM {$wpdb->prefix}lifterlms_sessions"; if ( $expired_only ) { $query .= $wpdb->prepare( ' WHERE expires < %d', time() ); } LLMS_Cache_Helper::invalidate_group( $this->cache_group ); return $wpdb->query( $query ); // phpcs:ignore: WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.0.0 | Introduced. |