LLMS_Student::delete_enrollment( int $product_id, string $trigger = 'any' )
Delete a student enrollment.
Description Description
See also See also
- `llms_delete_student_enrollment()`: calls this function without having to instantiate the LLMS_Student class first.
Parameters Parameters
- $product_id
-
(Required) WP Post ID of the course or membership.
- $trigger
-
(Optional) Only delete the student's enrollment if the original enrollment trigger matches the submitted value. "any" will remove regardless of enrollment trigger. Default "any".
Default value: 'any'
Return Return
(boolean) Whether or not the enrollment records have been successfully removed.
Source Source
File: includes/models/model.llms.student.php
Changelog Changelog
Version | Description |
---|---|
4.2.0 | The $enrollment_trigger parameter was added to the llms_user_enrollment_deleted action hook. |
3.36.2 | Added logic to physically remove from the membership level and remove enrollments data on related products. |
3.33.0 | Introduced. |