llms_delete_student_enrollment( int $user_id, int $product_id, string $trigger = 'any' )

Delete LifterLMS Student’s Enrollment record related to a given product.


Description Description

See also See also

  • `LLMS_Student->delete_enrollment()`: the class method wrapped by this function.

Top ↑

Parameters Parameters

$user_id

(int) (Required) WP User ID.

$product_id

(int) (Required) WP Post ID of the Course or Membership.

$trigger

(string) (Optional) Only delete the student enrollment if the original enrollment trigger matches the submitted value. Passing "any" will remove regardless of enrollment trigger.

Default value: 'any'


Top ↑

Return Return

(boolean) Whether or not the enrollment records have been successfully removed.


Top ↑

Source Source

File: includes/functions/llms.functions.person.php

function llms_delete_student_enrollment( $user_id, $product_id, $trigger = 'any' ) {
	$student = new LLMS_Student( $user_id );
	return $student->delete_enrollment( $product_id, $trigger );
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.33.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.