LLMS_Lesson::is_complete( int $user_id = null )

Determine if the lesson has been completed by a specific user


Parameters Parameters

$user_id

(int) (Optional) WP_User ID of a student. Default null. If not provided, or a falsy is provided, will fall back on the current user id.

Default value: null


Top ↑

Return Return

(bool)


Top ↑

Source Source

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

480
481
482
483
484
485
486
487
488
489
490
491
492
493
public function is_complete( $user_id = null ) {
 
    $user_id = $user_id ? $user_id : get_current_user_id();
 
    // Incomplete b/c no user.
    if ( ! $user_id ) {
        return false;
    }
 
    $student = new LLMS_Student( $user_id );
 
    return $student->is_complete( $this->get( 'id' ), 'lesson' );
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Refactored to utilize LLMS_Student->is_complete(). Added $user_id param.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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