WPWH_TRIGGERTRIGGERED::define_trigger()

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


Source Source

File: src/integrations/wp-webhooks/triggers/wpwh-triggertriggered.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/automator-core/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			'meta'                => $this->trigger_meta,
			'sentence'            => sprintf( __( '{{A webhook trigger:%1$s}} is triggered', 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Logged-in trigger - Formidable */
			'select_option_name'  => __( '{{A webhook trigger}} is triggered', 'uncanny-automator' ),
			'action'              => 'wpwhpro/admin/webhooks/webhook_trigger_sent',
			'priority'            => 10,
			'accepted_args'       => 4,
			'validation_function' => array( $this, 'save_data' ),
			'options'             => [
				Automator()->helpers->recipe->wp_webhooks->options->list_webhook_triggers( null, $this->trigger_meta ),
			],
		);

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

		return;
	}