learndash_user_course_access_expired

do_action( 'learndash_user_course_access_expired',  int $user_id,  int $course_id )

Fires when the user course access is expired.


Description #


Parameters #

$user_id

(int) User ID.

$course_id

(int) Course ID.


Source #

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


Examples #

 <?php
/**
 * Example usage for learndash_user_course_access_expired action.
 */
add_action(
	'learndash_user_course_access_expired',
	function( $user_id, $course_id ) {
		// Example 1: Check for specific user_id value.
		if ( ( ! empty( $user_id ) ) && ( $user_id == 12 ) ) {
			// Do something here.
		}

		// Example 2: Check for specific course_id value.
		if ( ( ! empty( $course_id ) ) && ( $course_id == 34 ) ) {
			// Do something here.
		}
	},
	30,
	2
);
 

Changelog #

Changelog
Version Description
2.6.2 Introduced.