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

$user_id

(int) (Required) WP_User ID.

$product_id

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

$relation

(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'

$use_cache

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

Default value: true


Top ↑

Return Return

(boolean)


Top ↑

Source Source

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

 *                              All = user must be enrolled in all $product_ids.
 *                              Any = user must be enrolled in at least one of the $product_ids.
 * @param bool      $use_cache  If true, returns cached data if available, if false will run a db query.
 * @return bool


Top ↑

Changelog 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.