llms_is_user_enrolled( int $user_id, int|int[] $product_id, string $relation = 'all', bool $use_cache = true )

Checks if user is currently enrolled in course

Description Description

See also See also

Top ↑

Parameters Parameters


(int) (Required) WP_User ID.


(int|int[]) (Required) WP Post ID of a Course, Lesson, or Membership or array of multiple IDs.


(string) (Optional) Comparator for enrollment check. All = user must be enrolled in all $product_ids. Any = user must be enrolled in at least one of the $product_ids.

Default value: 'all'


(bool) (Optional) If true, returns cached data if available, if false will run a db query.

Default value: true

Top ↑

Return Return


Top ↑

Source Source

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

function llms_is_user_enrolled( $user_id, $product_id, $relation = 'all', $use_cache = true ) {
	$student = new LLMS_Student( $user_id );
	return $student->is_enrolled( $product_id, $relation, $use_cache );

Top ↑

Changelog Changelog

Version Description
3.25.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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