HF_FORMSUBMIT::define_trigger()

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


Source Source

File: src/integrations/happyforms/triggers/hf-formsubmit.php

	public function define_trigger() {



		$trigger = array(
			'author'              => Automator()->get_author_name(),
			'support_link'        => Automator()->get_author_support_link( $this->trigger_code, 'integration/happyforms/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			/* translators: Anonymous trigger - HappyForms */
			'sentence'            => sprintf( esc_attr__( 'A user submits {{a form:%1$s}}', 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Anonymous trigger - HappyForms */
			'select_option_name'  => esc_attr__( 'A user submits {{a form}}', 'uncanny-automator' ),
			'action'              => 'happyforms_submission_success',
			'priority'            => 20,
			'accepted_args'       => 3,
			'validation_function' => array( $this, 'hf_form_submitted' ),
			'options'             => [
				Automator()->helpers->recipe->happyforms->options->all_happyforms_forms( null, $this->trigger_meta,
					[
						'include_any' => true,
						'any_label'   => esc_attr__( 'Any form', 'uncanny-automator' ),
					] ),
			],
		);

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

		return;
	}