LLMS_Sessions::end( LLMS_Event $start )
End a session.
Parameters Parameters
- $start
-
(LLMS_Event) (Required) Event object for a session start.
Return Return
(LLMS_Event|WP_Error)
Source Source
File: includes/class-llms-sessions.php
protected function end( $start ) {
$end = llms()->events()->record(
array(
'actor_id' => $start->get( 'actor_id' ),
'object_type' => 'session',
'object_id' => $start->get( 'object_id' ),
'event_type' => 'session',
'event_action' => 'end',
)
);
if ( ! is_wp_error( $end ) ) {
global $wpdb;
$wpdb->query(
$wpdb->prepare(
"
DELETE FROM {$wpdb->prefix}lifterlms_events_open_sessions
WHERE `event_id` = %d
",
$start->get( 'id' )
)
); // db call ok; no-cache ok.
}
return $end;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.5.0 | Delete open session entry from the wp_lifterlms_events_open_sessions table. |
| 3.36.0 | Introduced. |