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
Contents
Description Description
See also See also
- LLMS_Student->is_enrolled()
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
Return Return
(boolean)
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
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.25.0 | Introduced. |