llms_enroll_student( int $user_id, int $product_id, string $trigger = 'unspecified' )

Enroll a WordPress user in a course or membership


Description Description

See also See also

  • LLMS_Student->enroll(): 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) String describing the event that triggered the enrollment.

Default value: 'unspecified'


Top ↑

Return Return

(boolean)


Top ↑

Source Source

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

function llms_enroll_student( $user_id, $product_id, $trigger = 'unspecified' ) {
	$student = new LLMS_Student( $user_id );
	return $student->enroll( $product_id, $trigger );
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Added $trigger parameter.
2.2.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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