We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This would be really simple. The code is already there, we just need to add a setting to choose LD Courses, then this code to add the user.
// If not enrolled already. if ( ! $this->is_user_enrolled_to_course( $user_id, $course_id ) { // Enroll. ld_update_course_access( $user_id, $course_id, $remove = false ); } /** * Check if a user is already enrolled to a course * * @param int $user_id User ID * @param int $course_id Course ID * * @return bool True if enrolled|false otherwise */ function is_user_enrolled_to_course( $user_id = 0, $course_id = 0 ) { $enrolled_courses = learndash_user_get_enrolled_courses( $user_id ); return ( is_array( $enrolled_courses ) && in_array( $course_id, $enrolled_courses ) ); }
The text was updated successfully, but these errors were encountered:
Added via fc9cc46
Sorry, something went wrong.
No branches or pull requests
This would be really simple. The code is already there, we just need to add a setting to choose LD Courses, then this code to add the user.
The text was updated successfully, but these errors were encountered: