Browse: Home / Functions /

learndash_get_step_completed_transient_data

learndash_get_step_completed_transient_data( int $step_id,  int $course_id,  int $user_id )

Returns the step (Lesson or Topic) completed transient data when a step is completed by a user through the learndash_mark_complete_process function.


Description #

It’s a workaround to allow us to do some extra processing after the step is completed. This function only returns the data if the learndash_step_completed transient exists. By default, the transient expires in 10 minutes.

Note this function does not work for quizzes, as they don’t use the learndash_mark_complete_process function to complete the step.

If you need the step completion data in another context, you can use the learndash_course_get_step_completion_data function.


Parameters #

$step_id

(int) (Required) Step ID.

$course_id

(int) (Required) Course ID.

$user_id

(int) (Required) User ID.


Return #

(array{) is_course_completed: bool, is_course_completion_url: bool, next_step_id: int, next_step_url: string, }|false Returns the transient data or false if the transient does not exist.


Source #

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


Changelog #

Changelog
Version Description
4.21.3 Introduced.