LLMS_AJAX_Handler::membership_remove_auto_enroll_course( array $request )

Remove a course from the list of membership auto enrollment courses


Description Description

Called from "Auto Enrollment" tab of LLMS Membership Metaboxes.


Top ↑

Parameters Parameters

$request

(array) (Required) $_POST data.


Top ↑

Return Return

((void|WP_Error))


Top ↑

Source Source

File: includes/class.llms.ajax.handler.php

	 * @param array $request $_POST data.
	 * @return (void|WP_Error)
	 */
	public static function membership_remove_auto_enroll_course( $request ) {

		if ( empty( $request['post_id'] ) || empty( $request['course_id'] ) ) {
			return new WP_Error( 'error', __( 'Missing required parameters.', 'lifterlms' ) );
		}

		$membership = new LLMS_Membership( $request['post_id'] );

		if ( ! $membership->remove_auto_enroll_course( intval( $request['course_id'] ) ) ) {
			return new WP_Error( 'error', __( 'There was an error removing the course, please try again.', 'lifterlms' ) );


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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