UT_USERS_TIME_IN_COURSE_EXCEEDS::define_trigger()

Define and register the trigger by pushing it into the Automator object


Source Source

File: src/integrations/uncanny-toolkit/triggers/ut-users-time-in-course-exceeds.php

	public function define_trigger() {

		$trigger = array(
			'author'              => Automator()->get_author_name( $this->trigger_code ),
			'support_link'        => Automator()->get_author_support_link( $this->trigger_code, 'integration/uncanny-toolkit/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			'meta'                => $this->trigger_meta,
			/* translators: Logged-in trigger - Uncanny Toolkit */
			'sentence'            => sprintf( esc_attr__( "A user's time in {{a course:%1\$s}} exceeds {{a specific number of:%2\$s}} minutes", 'uncanny-automator' ), $this->trigger_meta, $this->trigger_meta . '_COURSEMINUTES' ),
			/* translators: Logged-in trigger - Uncanny Toolkit */
			'select_option_name'  => esc_attr__( "A user's time in {{a course}} exceeds {{a specific number of}} minutes", 'uncanny-automator' ),
			'action'              => 'uo_course_timer_add_timer',
			'priority'            => 20,
			'accepted_args'       => 3,
			'validation_function' => array( $this, 'users_limit_exceeds' ),
			'options_callback'    => array( $this, 'load_options' ),
		);

		Automator()->register->trigger( $trigger );
	}