Browse: Home / Functions /


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 #


(int|null) (Optional) User ID.

Default value: null


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

Default value: null


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

Default value: false


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


(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 #

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