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
- $action
-
(string) (Required) Name of the triggering action hook.
- $related_post_id
-
(int|string) (Required) WP_Post ID of the related post or an empty string.
Return Return
(string)
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'; break; 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 ); break; 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'; break; case 'lifterlms_access_plan_purchased': case 'lifterlms_product_purchased': $trigger_type = str_replace( 'llms_', '', get_post_type( $related_post_id ) ) . '_purchased'; break; } return $trigger_type; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.0.0 | Introduced. |