LLMS_Course::has_date_passed( string $date_key )
Compare a course meta info date to the current date and get a bool
Description Description
Parameters Parameters
- $date_key
-
(string) (Required) property key, eg "start_date" or "enrollment_end_date"
Return Return
(boolean) true when the date is in the past false when the date is in the future
Source Source
File: includes/models/model.llms.course.php
public function has_date_passed( $date_key ) { $now = current_time( 'timestamp' ); $date = $this->get_date( $date_key, 'U' ); // if there's no date, we can't make a comparison // so assume it's unset and unnecessary // so return 'false' if ( ! $date ) { return false; } else { return $now > $date; } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: