LP_COURSEENROLLED::lp_course_enrolled( $order_id,  $course_id,  $user_id )

Validation function when the trigger action is hit


Parameters Parameters

$order_id

(Required)

$course_id

(Required)

$user_id

(Required)


Source Source

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

	public function lp_course_enrolled( $course_id, $user_id, $result ) {
		if ( empty( $user_id ) ) {
			return;
		}

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