LLMS_Sessions::get_open_sessions( int $limit = 50, int $skip )

Retrieve open sessions.


Parameters Parameters

$limit

(int) (Optional) Number of sessions to return.

Default value: 50

$skip

(int) (Required) Number of sessions to skip.


Top ↑

Return Return

(LLMS_Event[])


Top ↑

Source Source

File: includes/class-llms-sessions.php

	protected function get_open_sessions( $limit = 50, $skip = 0 ) {

		global $wpdb;
		$sessions = $wpdb->get_col(
			$wpdb->prepare(
				"
			   SELECT event_id
			   FROM {$wpdb->prefix}lifterlms_events_open_sessions
			   ORDER BY event_id ASC
			   LIMIT %d, %d
		",
				$skip,
				$limit
			)
		); // db call ok; no-cache ok.

		$ret = array();
		if ( count( $sessions ) ) {
			foreach ( $sessions as $id ) {
				$ret[] = new LLMS_Event( $id );
			}
		}

		return $ret;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.5.0 Retrieve open sessions 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.