AFFWP_NEWAFFILIATE::define_trigger()

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


Source Source

File: src/integrations/affiliate-wp/triggers/affwp-newaffiliate.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/affiliatewp/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			/* translators: Logged-in trigger - Affiliate WP */
			'sentence'            => sprintf( __( 'A user becomes an affiliate', 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Logged-in trigger - Affiliate WP */
			'select_option_name'  => __( 'A user becomes an affiliate', 'uncanny-automator' ),
			'action'              => 'affwp_register_user',
			'priority'            => 99,
			'accepted_args'       => 3,
			'validation_function' => array( $this, 'affwp_user_becomes_affiliate' ),
			'options'             => array(),
		);
		Automator()->register->trigger( $trigger );
		return;
	}