LLMS_AJAX_Handler::bulk_enroll_students( array $request )
Add or remove a student from a course or membership
Parameters Parameters
- $request
-
(array) (Required) $_REQUEST object.
Return Return
((void|WP_Error))
Source Source
File: includes/class.llms.ajax.handler.php
public static function bulk_enroll_students( $request ) { if ( empty( $request['post_id'] ) || empty( $request['student_ids'] ) || ! is_array( $request['student_ids'] ) ) { return new WP_Error( 400, __( 'Missing required parameters', 'lifterlms' ) ); } $post_id = intval( $request['post_id'] ); foreach ( $request['student_ids'] as $id ) { llms_enroll_student( intval( $id ), $post_id, 'admin_' . get_current_user_id() ); } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.4.0 | Unknown. |
3.0.0 | Introduced. |