LP_LESSONDONE::lp_lesson_completed( $lesson_id,  $result,  $user_id )

Validation function when the trigger action is hit


Parameters Parameters

$lesson_id

(Required)

$result

(Required)

$user_id

(Required)


Source Source

File: src/integrations/learnpress/triggers/lp-lessondone.php

	public function lp_lesson_completed( $lesson_id, $result, $user_id ) {

		if ( is_null( $lesson_id ) ) {
			return;
		}



		$args = [
			'code'    => $this->trigger_code,
			'meta'    => $this->trigger_meta,
			'post_id' => intval( $lesson_id ),
			'user_id' => $user_id,
		];

		Automator()->maybe_add_trigger_entry( $args );
	}