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
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 ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.25.0 | Introduced. |