LD_MARKCOURSEDONE::mark_completes_a_course( $user_id,  $action_data,  $recipe_id )

Validation function when the action is hit


Parameters Parameters

$user_id

(Required)

$action_data

(Required)

$recipe_id

(Required)


Source Source

File: src/integrations/learndash/actions/ld-markcoursedone.php

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

		$course_id = $action_data['meta'][ $this->action_meta ];
		//$courses   = learndash_user_get_enrolled_courses( $user_id, array(), true );
		//if ( in_array( $course_id, $courses ) ) {
		$this->mark_steps_done( $user_id, $course_id );
		//all steps done.. mark course complete
		learndash_process_mark_complete( $user_id, $course_id );
		//}
		Automator()->complete_action( $user_id, $action_data, $recipe_id );
	}