learndash_update_course_access

do_action( 'learndash_update_course_access',  int $user_id,  int $course_id,  string $course_access_list,  boolean $remove )

Fires after a user’s list of courses are updated.


Description #


Parameters #

$user_id

(int) User ID.

$course_id

(int) Course ID.

$course_access_list

(string) A comma-separated list of user IDs used for the course_access_list field.

$remove

(boolean) Whether to remove course access from the user.


Source #

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


Examples #

 <?php
/**
 * Example usage for learndash_update_course_access action.
 */
add_action(
	'learndash_update_course_access',
	function( $user_id, $course_id, $course_access_list, $remove ) {
		// May add any custom logic using $user_id, $course_id, $course_access_list, $remove

		echo '<div>Custom content or markup</div>';
	},
	10,
	4
);
 

Changelog #

Changelog
Version Description
2.1.0 Introduced.