WPCW_COURSECOMPLETED::wpcw_course_completed( $user_id, $unit_id, $parent )
Validation function when the trigger action is hit
Contents
Parameters Parameters
- $user_id
-
(Required)
- $unit_id
-
(Required)
- $parent
-
(Required) AssociatedParentData
Source Source
File: src/integrations/wp-courseware/triggers/wpcw-coursecompleted.php
public function wpcw_course_completed( $user_id, $unit_id, $parent ) { if ( empty( $user_id ) ) { return; } $course_id = $parent->course_post_id; $args = [ 'code' => $this->trigger_code, 'meta' => $this->trigger_meta, 'post_id' => intval( $course_id ), 'user_id' => $user_id, ]; Automator()->maybe_add_trigger_entry( $args ); }
Expand full source code Collapse full source code View on Github