UC_CODESSUFFIX::define_trigger()

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


Source Source

File: src/integrations/uncanny-codes/triggers/uc-codessuffix.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-codes/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			'meta'                => $this->trigger_meta,
			/* translators: Logged-in trigger - Uncanny Codes */
			'sentence'            => sprintf( esc_attr__( 'A user redeems a code with a {{specific:%1$s}} suffix', 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Logged-in trigger - Uncanny Codes */
			'select_option_name'  => esc_attr__( 'A user redeems a code with a {{specific}} suffix', 'uncanny-automator' ),
			'action'              => 'ulc_user_redeemed_code',
			'priority'            => 20,
			'accepted_args'       => 3,
			'validation_function' => array( $this, 'user_redeemed_code_suffix' ),
			'options'             => [
				Automator()->helpers->recipe->uncanny_codes->options->get_all_code_suffix( esc_attr__( 'Suffix', 'uncanny-automator' ), $this->trigger_meta ),
			],
		);

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

		return;
	}