LLMS_Student::get_enrollment_date( int $product_id, string $date = 'enrolled', string $format = null )
Get the formatted date when a user initially enrolled in a product or when they were last updated
Parameters Parameters
- $product_id
-
(int) (Required) WP Post ID of a course or membership
- $date
-
(string) (Optional) "enrolled" will get the most recent start date, "updated" will get the most recent status change date
Default value: 'enrolled'
- $format
-
(string) (Optional) date format as accepted by php date(), if none supplied uses the WP core "date_format" option
Default value: null
Return Return
(false|string) will return false if the user is not enrolled
Source Source
File: includes/models/model.llms.student.php
$args['skip'], $args['limit'], ) ), 'OBJECT_K' ); // db call ok; no-cache ok. // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared $found = absint( $wpdb->get_var( 'SELECT FOUND_ROWS()' ) ); // db call ok; no-cache ok. return array( 'found' => $found, 'limit' => $args['limit'], 'more' => ( $found > ( ( $args['skip'] / $args['limit'] + 1 ) * $args['limit'] ) ), 'skip' => $args['skip'], 'results' => array_keys( $query ), ); } /** * Get the formatted date when a user initially enrolled in a product or when they were last updated * * @since 3.0.0 * @since 3.35.0 Prepare SQL properly. * * @param int $product_id WP Post ID of a course or membership * @param string $date "enrolled" will get the most recent start date, "updated" will get the most recent status change date * @param string $format date format as accepted by php date(), if none supplied uses the WP core "date_format" option * @return false|string will return false if the user is not enrolled
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.35.0 | Prepare SQL properly. |
3.0.0 | Introduced. |