Browse: Home / Functions /

learndash_process_user_course_progress_update

learndash_process_user_course_progress_update( int $user_id,  array $user_progress = array(),  bool $force = false )

Process user course progress changes.


Description #


Parameters #

$user_id

(int) (Required) User ID to update.

$user_progress

(array) (Optional) User progress array.

Default value: array()

$force

(bool) (Optional) Whether to force the progress update to bypass requirements.

Default value: false


Return #

(array) Array of processed course IDs. The user_progress structure should be as the following: The top-level nodes are 'course' and 'quiz'. Within each of these there is an array of course IDs. Within the course array there is an array of course steps. array( [course] => array ( [123] => array( [completed] => 0 [total] => 6 [lessons] => array( [111] => 1 [222] => 1 ) [topics] => array ( [111] => array ( [555] => 1 [666] => 1 ) ) ) ) [quiz] => array ( [123] => array ( [888] => 1 [999] => 1 ) ) )


Source #

File: includes/ld-users.php


Changelog #

Changelog
Version Description
4.12.1 Added $force parameter.
4.0.0 Introduced.