Browse: Home / Hooks /

learndash_course_status

apply_filters( 'learndash_course_status',  string $course_status_str,  int $course_id,  int $user_id,  array $course_progress )

Filters the current status of the course.


Description #


Parameters #

$course_status_str

(string) The translatable current course status string.

$course_id

(int) Course ID.

$user_id

(int) User ID.

$course_progress

(array) Current course progress.


Source #

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


Examples #

Note: Extended code example below not guaranteed, you may need to consult with a developer

 <?php
/**
 * Example usage for learndash_course_status filter.
 */
add_filter(
	'learndash_course_status',
	function( $course_status_str, $course_id, $user_id, $name ) {
		// May add any custom logic using $course_status_str, $course_id, $user_id, $name.

		// Always return $course_status_str.
		return $course_status_str;
	},
	10,
	4
);