ANON_CF7_SUBFORM::define_trigger()

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


Source Source

File: src/integrations/contact-form7/triggers/anon-cf7-subform.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/contact-form-7/' ),
			'is_pro'              => false,
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			'meta'                => $this->trigger_meta,
			/* translators: Anonymous trigger - Contact Form 7 */
			'sentence'            => sprintf( __( '{{A form:%1$s}} is submitted', 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Anonymous trigger - Contact Form 7 */
			'select_option_name'  => __( '{{A form}} is submitted', 'uncanny-automator' ),
			'action'              => 'wpcf7_submit',
			'type'                => 'anonymous',
			'priority'            => 99,
			'accepted_args'       => 2,
			'validation_function' => array( $this, 'wpcf7_submit' ),
			'options'             => [
				Automator()->helpers->recipe->contact_form7->options->list_contact_form7_forms( null, $this->trigger_meta ),
			],
		);

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