Browse: Home / Functions /

learndash_process_mark_complete

learndash_process_mark_complete( int|null $user_id = null,  int|null $postid = null,  bool $onlycalculate = false,  int $course_id,  bool $force = false )

Updates the user meta with completion status for any resource.


Description #


Parameters #

$user_id

(int|null) (Optional) User ID.

Default value: null

$postid

(int|null) (Optional) The ID of the resource like course, lesson, topic, etc.

Default value: null

$onlycalculate

(bool) (Optional) Whether to mark the resource as complete.

Default value: false

$course_id

(int) (Optional) Course ID. Default 0.

$force

(bool) (Optional) Whether to force the completion when should not be completed.

Default value: false


Return #

(bool) Returns true if the meta is updated successfully, otherwise false.


Source #

File: includes/course/ld-course-progress.php


Changelog #

Changelog
Version Description
4.11.0 Added the $force parameter.
2.1.0 Introduced.