LLMS_Sessions::end( LLMS_Event $start )

End a session.


Parameters Parameters

$start

(LLMS_Event) (Required) Event object for a session start.


Top ↑

Return Return

(LLMS_Event|WP_Error)


Top ↑

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;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.5.0 Delete open session entry from the wp_lifterlms_events_open_sessions table.
3.36.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.