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.


Top ↑

Return Return

((void|WP_Error))


Top ↑

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() );
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.4.0 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.