LLMS_Lesson::is_available()

Determine if an element is available based on drip settings


Description Description

If no settings, this will return true if the posts’s published date is in the past.


Top ↑

Return Return

(boolean)


Top ↑

Source Source

File: includes/models/model.llms.lesson.php

	public function is_available() {

		$drip_method = $this->get( 'drip_method' );

		// Drip is no enabled, so the element is available.
		if ( ! $drip_method ) {
			return true;
		}

		$available = $this->get_available_date( 'U' );
		$now       = llms_current_time( 'timestamp' );

		return ( $now > $available );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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