Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Engagements::parse_hook_find_trigger_type( string $action, int|string $related_post_id )

Get the engagement trigger type based on the action and related post id

Parameters Parameters


(string) (Required) Name of the triggering action hook.


(int|string) (Required) WP_Post ID of the related post or an empty string.

Top ↑

Return Return


Top ↑

Source Source

File: includes/class.llms.engagements.php

	private function parse_hook_find_trigger_type( $action, $related_post_id ) {

		$trigger_type = '';

		switch ( $action ) {
			case 'llms_rest_student_registered':
			case 'lifterlms_created_person':
			case 'lifterlms_user_registered':
				$trigger_type = 'user_registration';

			case 'lifterlms_course_completed':
			case 'lifterlms_course_track_completed':
			case 'lifterlms_lesson_completed':
			case 'lifterlms_section_completed':
			case 'lifterlms_quiz_completed':
			case 'lifterlms_quiz_passed':
			case 'lifterlms_quiz_failed':
				$trigger_type = str_replace( 'lifterlms_', '', $action );

			case 'llms_user_added_to_membership_level':
			case 'llms_user_enrolled_in_course':
				$trigger_type = str_replace( 'llms_', '', get_post_type( $related_post_id ) ) . '_enrollment';

			case 'lifterlms_access_plan_purchased':
			case 'lifterlms_product_purchased':
				$trigger_type = str_replace( 'llms_', '', get_post_type( $related_post_id ) ) . '_purchased';

		return $trigger_type;


Top ↑

Changelog Changelog

Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.