learndash_user_get_enrolled_courses( int $user_id, array $course_query_args = array(), boolean $bypass_transient = false )
Gets the list of all courses enrolled by the user.
Contents
Description #
Parameters #
- $user_id
-
(int) (Optional) User ID. Default 0.
- $course_query_args
-
(array) (Optional) An array of
WP_Query
arguments.Default value: array()
- $bypass_transient
-
(boolean) (Optional) Whether to bypass the transient cache or not.
Default value: false
Return #
(array) An array of courses enrolled by user.
Source #
File: includes/ld-users.php
Changelog #
Version | Description |
---|---|
2.2.1 | Introduced. |
Related #
Uses #
Uses | Description |
---|---|
includes/course/ld-course-functions.php: learndash_can_user_autoenroll_courses () |
Check if user can auto-enroll in courses. |
includes/class-ldlms-transients.php: LDLMS_Transients::get () |
Get a Transient |
includes/class-ldlms-transients.php: LDLMS_Transients::set () |
Utility function to interface with WP set_transient function. This function allow for filtering if to actually write the transient. |
includes/ld-users.php: learndash_get_user_course_access_list () |
Gets the list of course IDs accessible by the user. |
includes/ld-users.php: learndash_get_user_courses_from_meta () |
Gets all courses for the user via the user meta ‘course_XXX_access_from’. |
includes/ld-users.php: learndash_get_user_groups_courses_ids () |
Gets all courses accessible by the user’s groups. |
includes/course/ld-course-functions.php: learndash_use_legacy_course_access_list () |
Checks whether to use the legacy course access list. |
includes/course/ld-course-functions.php: learndash_get_open_courses () |
Gets all the courses with the price type open. |
includes/course/ld-course-functions.php: learndash_get_paynow_courses () |
Gets all the courses with the price type paynow. |
Used By #
Used By | Description |
---|---|
includes/rest-api/v2/class-ld-rest-courses-steps-controller.php: LD_REST_Courses_Steps_Controller_V2::get_course_steps_permissions_check () |
Permissions check for getting coure steps. |
includes/rest-api/v2/class-ld-rest-lessons-controller.php: LD_REST_Lessons_Controller_V2::get_item_permissions_check () |
Check user permission to get/access single Lesson. |
includes/rest-api/v2/class-ld-rest-essays-controller.php: LD_REST_Essays_Controller_V2::get_item_permissions_check () |
Check user permission to get/access single item. |
includes/rest-api/v2/class-ld-rest-users-courses-controller.php: LD_REST_Users_Courses_Controller_V2::rest_query_filter () |
Filter Users Courses query args. |
includes/rest-api/v2/class-ld-rest-quizzes-controller.php: LD_REST_Quizzes_Controller_V2::get_item_permissions_check () |
Check user permission to get/access single Quiz. |
includes/rest-api/v2/class-ld-rest-topics-controller.php: LD_REST_Topics_Controller_V2::get_item_permissions_check () |
Check user permission to get/access single Topic. |
includes/rest-api/v2/class-ld-rest-assignments-controller.php: LD_REST_Assignments_Controller_V2::get_item_permissions_check () |
Check user permission to get/access single Lesson. |
includes/admin/classes-posts-listings/class-learndash-admin-users-listing.php: Learndash_Admin_Users_Listing::show_column_user_groups_courses () |
Show the User Courses column. |
includes/admin/classes-posts-listings/class-learndash-admin-courses-listing.php: Learndash_Admin_Courses_Listing::listing_table_query_vars_filter_courses () |
This function is documented in includes/admin/class-learndash-admin-posts-listing.php |
includes/class-ld-search.php: LearnDash_Search::pre_get_posts () |
Filter WP_Query instance to add LD search logic. |
themes/ld30/includes/helpers.php: learndash_get_user_stats () |
Gets the user statistics. |
includes/ld-users.php: learndash_user_set_enrolled_courses () |
Enrolls the user in new courses. |
includes/ld-users.php: learndash_get_user_course_access_list () |
Gets the list of course IDs accessible by the user. |
includes/ld-reports.php: learndash_report_user_courses_progress () |
Gets the users course progress for the report. |
includes/ld-reports.php: learndash_reports_get_activity () |
Queries the user activity for the report. |
includes/rest-api/v1/class-ld-rest-users-courses-controller.php: LD_REST_Users_Courses_Controller_V1::get_user_courses () | |
includes/rest-api/v1/class-ld-rest-lessons-controller.php: LD_REST_Lessons_Controller_V1::get_item_permissions_check () | |
includes/rest-api/v1/class-ld-rest-courses-steps-controller.php: LD_REST_Courses_Steps_Controller_V1::get_course_steps_permissions_check () | |
includes/rest-api/v1/class-ld-rest-quizzes-controller.php: LD_REST_Quizzes_Controller_V1::get_item_permissions_check () | |
includes/rest-api/v1/class-ld-rest-topics-controller.php: LD_REST_Topics_Controller_V1::get_item_permissions_check () | |
includes/course/ld-course-user-functions.php: ld_get_mycourses () |
Gets the array of courses that can be accessed by the user. |
includes/shortcodes/ld_course_list.php: ld_course_list () |
Builds the |
includes/admin/class-learndash-admin-user-profile-edit.php: Learndash_Admin_User_Profile_Edit::show_user_courses () |
Show User Enrolled Courses Binary Selector. |
includes/admin/classes-data-reports-actions/class-learndash-admin-data-reports-user-courses.php: Learndash_Admin_Data_Reports_Courses::process_report_action () |
Class method for the AJAX update logic This function will determine what users need to be converted. Then the course and quiz functions will be called to convert each individual user data set. |