LLMS_Course_Data::get_unenrollments( tring $period = 'current' )

Retrieve the number of unenrollments on a given date.


Parameters Parameters

$period

(tring) (Optional) Date period [current|previous]. Default 'current'.

Default value: 'current'


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/class.llms.course.data.php

272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
public function get_unenrollments( $period = 'current' ) {
 
    global $wpdb;
 
    return $wpdb->get_var(
        $wpdb->prepare(
            "
        SELECT DISTINCT COUNT( user_id )
        FROM {$wpdb->prefix}lifterlms_user_postmeta
        WHERE meta_value != 'enrolled'
          AND meta_key = '_status'
          AND post_id = %d
          AND updated_date BETWEEN %s AND %s
        ",
            $this->post_id,
            $this->get_date( $period, 'start' ),
            $this->get_date( $period, 'end' )
        )
    );// db call ok; no-cache ok.
 
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.15.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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