function course_remove_enrollment_action in Course 7.2
Same name and namespace in other branches
- 6 course.module \course_remove_enrollment_action()
- 7 course.module \course_remove_enrollment_action()
Deprecated
Use core "Delete item" bulk action.
Action to unenroll a user.
File
- ./
course.module, line 1946 - course.module Core functionality for Courses.
Code
function course_remove_enrollment_action(&$enrollment, $context) {
$node = node_load($enrollment->nid);
$user = user_load($enrollment->uid);
course_unenroll($node, $user);
}