llms_unenroll_student( int $user_id, int $product_id, string $new_status = 'expired', string $trigger = 'any' )

Remove a LifterLMS Student from a course or membership


Description Description

See also See also

  • LLMS_Student->unenroll(): 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.

$new_status

(string) (Optional) The value to update the new status with after removal is complete.

Default value: 'expired'

$trigger

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

Default value: 'any'


Top ↑

Return Return

(boolean)


Top ↑

Source Source

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

function llms_unenroll_student( $user_id, $product_id, $new_status = 'expired', $trigger = 'any' ) {
	$student = new LLMS_Student( $user_id );
	return $student->unenroll( $product_id, $trigger, $new_status );
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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