TUTORLMS_LESSONCOMPLETED::complete()

Validates Trigger.


Source Source

File: src/integrations/tutorlms/triggers/tutorlms-lessoncompleted.php

	public function complete() {

		// global post object.
		global $post;

		// Is this the registered lesson post type
		if ( tutor()->lesson_post_type !== $post->post_type ) {
			return;
		}

		// current user.
		$user_id = get_current_user_id();

		// trigger entry args.
		$args = [
			'code'    => $this->trigger_code,
			'meta'    => $this->trigger_meta,
			'post_id' => $post->ID,
			'user_id' => $user_id,
		];



		// run trigger.
		Automator()->maybe_add_trigger_entry( $args );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.4.0 Introduced.