LLMS_Section::get_percent_complete( string $user_id = '', bool $use_cache = true )
Retrieve section completion percentage
Description Description
See also See also
Parameters Parameters
- $user_id
-
(string) (Optional) WP_User ID, if none supplied uses current user (if exists). Default is empty string.
Default value: ''
- $use_cache
-
(bool) (Optional) When true, uses results from from the wp object cache (if available). Default is
false.Default value: true
Return Return
(float)
Source Source
File: includes/models/model.llms.section.php
public function get_percent_complete( $user_id = '', $use_cache = true ) {
$student = llms_get_student( $user_id );
if ( ! $student ) {
/** This filter is documented in includes/models/model.llms.student.php */
return apply_filters( 'llms_student_get_progress', 0, $this->get( 'id' ), 'section', $user_id );
}
return $student->get_progress( $this->get( 'id' ), 'section', $use_cache );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.24.0 | Introduced. |