LD_ENRLCOURSE_A::enroll_in_course( $user_id,  $action_data,  $recipe_id )

Validation function when the trigger action is hit


Parameters Parameters

$user_id

(Required)

$action_data

(Required)

$recipe_id

(Required)


Source Source

File: src/integrations/learndash/actions/ld-enrlcourse-a.php

	public function enroll_in_course( $user_id, $action_data, $recipe_id ) {



		if ( ! function_exists( 'ld_update_course_access' ) ) {
			$error_message = 'The function ld_update_course_access does not exist';
			Automator()->complete_action( $user_id, $action_data, $recipe_id, $error_message );

			return;
		}

		$course_id = $action_data['meta'][ $this->action_meta ];

		//Enroll to New Course
		ld_update_course_access( $user_id, $course_id );

		Automator()->complete_action( $user_id, $action_data, $recipe_id );
	}