LF_MARKLESSONDONE::lf_mark_lesson_done( string $user_id, array $action_data, string $recipe_id,  $args )

Validation function when the action is hit.


Parameters Parameters

$user_id

(string) (Required) user id.

$action_data

(array) (Required) action data.

$recipe_id

(string) (Required) recipe id.


Source Source

File: src/integrations/lifterlms/actions/lf-marklessondone.php

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



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

			return;
		}

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

		// Mark lesson completed.
		llms_mark_complete( $user_id, $lesson_id, 'lesson' );

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